https://www.hackerrank.com/challenges/journey-to-the-moon