The idea behind this solution is to solve the problem for simpler cases to help solve the larger problem(bottom-up process). We created an array arr
where arr[i]
will represent the max amount of money we can rob up to and including the current house. Once we populate the array, we simply return the last entry which represents the max amount of money we can rob given the constraints.
Mark As Completed Discussion

