Frage im Vorstellungsgespräch bei IBM

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