Reverse words in a string - implemented using STACK and library split method