HackerRank interview question

See interview process answer.