Bot-saves-princess 2 HackerRank implementation