HackerRank warmup problem