HackerRank Bot Saves Princess Java Implementation