HackerRank weekly contest #12. Day 1