This is one of the n solutions for a problem proposed by Google in the Google Code Jam event for the qualifying round Africa 2010
$ [sudo] git clone git@github.com:davidenq/reverse-words.git
cd /reverse-words
Below is showed a simple example about how to execute this module.
In index.js
file you must indicate what file you want to read.
file = fs.readFileSync('./B-small-practice.in', 'utf8');
Execute
node index.js
Outcome
Case #1: test a is this
Case #2: foobar
Case #3: base your all
Case #4: class
Case #5: along pony
In order to validate the outcome, you should execute the script, then you must copy the result in a file and then, visit the page Reverse Words, choose the Solve B-small button or Solve B-large button, upload the file and finally Google show you whether the result is right.
MIT Licence