[leetcode] 198. House Robber 힌트
var rob = function(nums) {
const n = nums.length;
for (let i = n - 1; i >= 0; i--) {
let max = 0;
let j = i + 2;
const target = j + 2;
while (j < target && j < n) {
if (nums[j] > max) {
max = nums[j];
}
j++;
}
nums[i] += max;
}
return Math.max(...nums.slice(0, 2));
};