TADM2E 3.26
From Algorithm Wiki
1. Reverse the whole string. 2. Reverse each word in the string.
Space is O(1), time is O(n).
1. Reverse the whole string. 2. Reverse each word in the string.
Space is O(1), time is O(n).