JavaScript, React, Python, Angular, HTML.
the house two steps ahead let robCurrent = nums[index] + robHelper(nums, index + 2); // Skip the current house and move to the next house let skipCurrent = robHelper(nums, index + 1); return Math.max(robCurrent, skipCurrent); } const nums = [1, 2, 3, 1]; console.log(rob(nums)); // Output: 4