Solution for the Reverse Words problem.