All challenges

Algorithm challenge · DSA

House Robber

Difficulty

medium

Time

~25m

Format

Single

Grading

Auto-graded

#python#javascript#typescript#go#java#cpp#rust#dsa#dynamic-programming
Mission file // read carefullymedium

Given nums (money in each house), return the max you can rob without robbing two adjacent houses.

nums = [2,7,9,3,1]  =>  12   (2 + 9 + 1)

Build with

rob(nums: int[]) → int
PythonJavaScriptTypeScriptGoJavaC++Rust
4 tests · 1 hidden
Auto-graded on submit
Start challenge

Sign in to save your progress.