Google Code Jam Solution to "Reverse Words"