{"title":"LeetCode 213. House Robber II","author_name":"cindychen0204","description":"Very interesting question 0 ~ n - 2 \u307e\u305f 1 ~ n -1 \u306b\uff12\u3064\u306b\u5206\u3051\u308b\u3053\u3068\u3092\u601d\u3044\u3064\u304b\u306a\u304b\u3063\u305f\u306a\u3002 class Solution { public int rob(int[] nums) { int n = nums.length; if (n <= 3){ int max = 0; for (int i = 0; i < n; i++){ max = Math.max(nums[i], max); } return max; } return Math.max(findMaxSum(nums, 0, n - 1), findMaxSum(nums, 1,\u2026","blog_title":"Cindy's Blog","categories":[],"provider_name":"Hatena Blog","blog_url":"https://cindychen0204.hatenablog.com/","type":"rich","height":"190","width":"100%","version":"1.0","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/cindychen0204/","url":"https://cindychen0204.hatenablog.com/entry/2022/10/07/LeetCode_213._House_Robber_II","published":"2022-10-07 18:45:35","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcindychen0204.hatenablog.com%2Fentry%2F2022%2F10%2F07%2FLeetCode_213._House_Robber_II\" title=\"LeetCode 213. House Robber II - Cindy&#39;s Blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null}