Solution to the old hackerrank.com pre-beta challenges.