title: Interview Question : Trim multiple consecutive spaces from a string
body: <p>This is an interview question
  Looking for best optimal solution to trim multiple spaces from a string. This operation should be in-place operation.</p>
  
  <pre><code>input  = "I    Like    StackOverflow a      lot"
  output = "I Like StackOverflow a lot"
  </code></pre>
  
  <p>String functions are not allowed, as this is an interview question. Looking for an algorithmic solution of the problem.</p>