Amazon Interview Question

House robber leetcode problem was given.