Add solution to Reddit dailyprogrammer challenge #127.