当前位置:网站首页>213. house raiding II
213. house raiding II
2022-06-11 07:01:00 【Not coriander】
You are a professional thief , Plan to steal houses along the street , There is a certain amount of cash in every room . All the houses in this place are Make a circle , This means that the first house and the last house are next to each other . meanwhile , Adjacent houses are equipped with interconnected anti-theft system , If two adjacent houses are broken into by thieves on the same night , The system will automatically alarm .
Given an array of non negative integers representing the storage amount of each house , Count you Without triggering the alarm device , The maximum amount you can steal tonight .
Example 1:
Input :nums = [2,3,2]
Output :3
explain : You can't steal first 1 House No ( amount of money = 2), And then steal 3 House No ( amount of money = 2), Because they are next to each other .
Example 2:
Input :nums = [1,2,3,1]
Output :4
explain : You can steal first 1 House No ( amount of money = 1), And then steal 3 House No ( amount of money = 3).
Maximum amount stolen = 1 + 3 = 4 .
Example 3:
Input :nums = [0]
Output :0
Tips :
1 <= nums.length <= 100
0 <= nums[i] <= 1000
边栏推荐
- Summary of string processing skills II
- 关于组织开展2022年宁波市重点首版次软件申报工作的通知
- The realization of online Fox game server room configuration battle engagement customization function
- Illustration of JS implementation from insertion sort to binary insertion sort [with source code]
- 【Matlab印刷字符识别】OCR印刷字母+数字识别【含源码 1861期】
- A highly controversial issue
- Oracle prompt invalid number
- Do you use typescript or anyscript
- Deep Attentive Tracking via Reciprocative Learning
- ESP32学习笔记(49)——ESP-WIFI-MESH接口使用
猜你喜欢

Heartless sword Chinese English bilingual poem 001 Love

你知道IT人才外派服务报价是怎样的么?建议程序员也了解下

JVM from getting started to abandoning 1: memory model

saltstack部署lnmp

Difference between byte and bit

LEARNING TARGET-ORIENTED DUAL ATTENTION FOR ROBUST RGB-T TRACKING

网狐游戏服务器房间配置向导服务定制功能页实现

During unity panoramic roaming, AWSD is used to control lens movement, EQ is used to control lens lifting, and the right mouse button is used to control lens rotation.

Whether the ZABBIX monitoring host is online

Do you use typescript or anyscript
随机推荐
Library management system 1- project approval
Implementation of customization function page of online Fox game server room configuration wizard service
Cv2.rectangle() picture frame
es5和es6的学习小记
Illustrate the principle of one-way linked list and the method of JS to realize linked list [with source code]
关于 QtCreator的设计器QtDesigner完全无法正常拽托控件 的解决方法
Luogu p1091 chorus formation (longest ascending subsequence)
Summary of string processing skills II
Esp32 learning notes (49) - esp-wifi-mesh interface use
Stack -- one of two common linear structures of linear structure
The meaning and research significance of mathematical methodology
.NET C#基础(6):命名空间 - 有名字的作用域
Xunwei dry goods | Ruixin micro rk3568 development board TFTP & NFS writing (Part 1)
洛谷P1091合唱队形(最长上升子序列)
saltstack部署zabbix状态文件编写
Deep Attentive Tracking via Reciprocative Learning
Matplotlib,设置坐标刻度大小,字体/设置图例大小及字体/设置纵横坐标名称及字体及大小
About the designer of qtcreator the solution to the problem that qtdesigner can't pull and hold controls normally
Post exam summary
【LeetCode】-- 17.电话号码的字母组合