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