03.06 · Problem
House Robber
Houses stand in a row, and house i holds nums[i] rupees. You can’t take from two neighbouring houses. Return the most you can take.
Examples
Example 1
Input: nums = [1, 2, 3, 1]
Output: 4
Houses 0 and 2: 1 + 3.
solulu Pro
Continue this problem with Pro
Inside: step-by-step hints · 10 hidden tests · reference solutions · code editor.
Lifetime ₹1,999 ₹999 · Launch offer
Item 25 of 44 · updated 2026-10-13