Amazon Interview Question

House robber variation from Leetcode