当前位置:网站首页>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
边栏推荐
- [MATLAB image fusion] particle swarm optimization adaptive multispectral image fusion [including source code phase 004]
- Post exam summary
- 迅为干货 |瑞芯微RK3568开发板TFTP&NFS烧写(上)
- Promises/a+ standard Chinese Translation
- Array information management system reconfiguration preheating (1) how to write basic logic using linear continuous structure?
- WPF data binding (IV)
- First day of database
- Pytest automated test - easy tutorial (01)
- Aircraft battle from scratch (III) flight between player aircraft and enemy aircraft
- Check whether the filing information of the medical representative is correct
猜你喜欢

Esp32 learning notes (49) - esp-wifi-mesh interface use
![JS implementation of Hill sort of graphic insertion sort [with source code]](/img/5a/b89fd5a0ebbc7ca17cc3e1fcb37c8f.jpg)
JS implementation of Hill sort of graphic insertion sort [with source code]

saltstack部署lnmp

Won't virtual DOM be available in 2022? Introduction to virtual Dom and complete implementation of diff and patch

Do you know what the quotation for it talent assignment service is? It is recommended that programmers also understand

Records how cookies are carried in cross domain requests

1266_FreeRTOS调度器启动代码实现分析

Use of qscriptengine class

【LeetCode】-- 17.电话号码的字母组合

A highly controversial issue
随机推荐
The meaning and research significance of mathematical methodology
Quality-aware Feature Aggregation Networkfor Robust RGBT Tracking
Detailed explanation of mutationobserver
Appclips & tips (continuous update)
Common modules of saltstack
Saltstack deployment ZABBIX state file writing
. Net C Foundation (6): namespace - scope with name
Summary of string processing skills III
**Count the characters with the largest number of words**
[MATLAB image encryption and decryption] chaotic sequence image encryption and decryption (including correlation test) [including GUI source code 1862]
RGB-D Salient Object Detection withCross-Modality Modulation and Selection
client-go gin的简单整合六-list-watch二(关于Rs与Pod以及Deployment的完善)
Unity 全景漫游过程中使用AWSD控制镜头移动,EQ控制镜头升降,鼠标右键控制镜头旋转。
Saltstack deployment LNMP
Esp32 learning notes (49) - esp-wifi-mesh interface use
【Matlab WSN通信】A_Star改进LEACH多跳传输协议【含源码 487期】
品牌定位个性六种形态及结论的重大意义
This comprehensive understanding
Method to determine whether it is an array
Implementation of customization function page of online Fox game server room configuration wizard service