Amazon Interview Question

House Robber 3 from leetcode