Zillow interview question

Solve a hacker rank problem.