198. House Robber

#dp

Problem

Intuition

We need to know the subsequences. As we are iterating from left to right and we need to pick non-adjacent houses.

We are generating all possible subsequences with the given constraint and maintaining max possible money we can rob. A subsequence need not be only one step away, it can be "n" steps away.

Time Complexity

Space Complexity

Solution

Last updated