All Problems

House Robber

MediumarrayExpected: O(n) time, O(n) spaceInterview Context
dynamic-programming

Problem

Given an array representing money in each house, return the maximum amount you can rob without robbing two adjacent houses.

Loading...