Amazon interview question

House robber leetcode problem was given.