Amazon interview question

House robber variation from Leetcode