solulubeta
Sign in
Recursion & Memo / From recursion to memoization
03.06 · Problem

House Robber

Medium Take or skip, no two adjacent LC 198 Pro

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
Mark this problem as solved when you are finished.

Item 25 of 44 · updated 2026-10-13