码迷,mamicode.com
首页 >  
搜索关键字:robber    ( 302个结果
LeetCode 198. House Robber
## 198. House RobberYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only co ...
分类:其他好文   时间:2021-04-23 12:11:50    阅读次数:0
打家劫舍2
此博客链接: 打家劫舍2 题目链接:https://leetcode-cn.com/problems/house-robber-ii/ 题目 你是一个专业的小偷,计划偷窃沿街的房屋,每间房内都藏有一定的现金。这个地方所有的房屋都 围成一圈 ,这意味着第一个房屋和最后一个房屋是紧挨着的。同时,相邻的房 ...
分类:其他好文   时间:2021-04-06 14:59:12    阅读次数:0
leetcode198 - House Robber - easy
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo ...
分类:其他好文   时间:2020-10-27 10:55:44    阅读次数:21
337. House Robber III
https://leetcode-cn.com/problems/house-robber-iii/solution/da-jia-jie-she-iii-by-leetcode-solution/ class Solution { public: unordered_map <TreeNode*, ...
分类:其他好文   时间:2020-08-05 23:24:01    阅读次数:97
[LeetCode] 198. House Robber
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo ...
分类:其他好文   时间:2020-05-29 09:41:12    阅读次数:49
LeetCode 198. 打家劫舍
https://leetcode-cn.com/problems/house-robber/ 经典dp问题. /** * 打家劫舍问题,这个是这类问题中最简单的一题 * @param nums * @return */ public int rob(int[] nums) { int length ...
分类:其他好文   时间:2020-05-29 09:28:12    阅读次数:77
LeetCode 198:House Robber
题意描述 给定一个非负整数数组,找出其中累加和的最大值,并且相邻元素不能进行累加。 测试用例 Input: [1,2,3,1] Output: 4 Explanation: Total amount you can rob = 1 + 3 = 4. Input: [2,7,9,3,1] Output ...
分类:其他好文   时间:2020-05-17 01:20:57    阅读次数:63
4. 树形DP
337. 打家劫舍 III https://leetcode-cn.com/problems/house-robber-iii/ /** * Definition for a binary tree node. * type TreeNode struct { * Val int * Left *T ...
分类:其他好文   时间:2020-04-26 11:12:02    阅读次数:55
1、线性DP 213. 打家劫舍 II
https://leetcode-cn.com/problems/house-robber-ii/ //rob 0, not rob n-1 || not rob 0,not rob n-1 ==>rob(0,nums.length-2,nums) //not rob 0,rob n-1 || no ...
分类:其他好文   时间:2020-04-26 10:50:46    阅读次数:45
[LeetCode] 337. 打家劫舍III ☆☆☆(动态规划)
https://leetcode-cn.com/problems/house-robber-iii/solution/tong-yong-si-lu-tuan-mie-da-jia-jie-she-wen-ti-b-2/ 描述 在上次打劫完一条街道之后和一圈房屋后,小偷又发现了一个新的可行窃的地区。 ...
分类:其他好文   时间:2020-04-06 17:09:36    阅读次数:61
302条   1 2 3 4 ... 31 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!