IBM Interview Question

Two coding problems on HackerRank. One was easy, one was difficult.