<p>Given an array of characters which forms a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.</p>

<p>Example input and output:</p>

<pre><code>&gt;&gt;&gt; reverse_words("this is a string")
'string a is this'
</code></pre>

<p>It should be O(N) time and O(1) space (<code>split()</code> and pushing on / popping off the stack are not allowed).</p>

<p>The puzzle is taken from <a href="http://halcyon.usc.edu/~kiran/msqs.html#programming" rel="noreferrer" title="Microsoft Interview Questions">here</a>.</p>

In pseudo code:
```
```
reverse input string
reverse each word (you will need to find word boundaries)
```
```