How to solve the problem of House Robber III efficiently?