Yahoo Interview Question

Write a routine to reverse a string and then reverse only the individual words in the same string using the routine.

Interview Answer

Anonymous

Oct 3, 2009

To reverse only the words: 1) Reverse the entire string 2) Reverse again just the substrings on white-space boundaries. The words are now forward but in reverse order.

2