title: Recursively remove all adjacent duplicates
body: <p>Find an algorithm to <a href="http://www.geeksforgeeks.org/recursively-remove-adjacent-duplicates-given-string/" rel="nofollow">recursively remove all adjacent duplicates in a given string</a> this is the original question.I have thought of an algorithm using stacks.</p>
  
  <pre><code>1.Initialize a stack  and a char_popped variable
  2.Push the first char of str into the stack.
  3.now iterate through the characters of string.
  if the top of stack matches with the character 
  {
  pop the character from the stack,
  char_popped=character
  }
  else
  {
    if(character==char_popped)
           {DONT DO ANYTHING}
    else
           push the character on the stack
           char_popped=null
  }
  </code></pre>
  
  <p>Whatever is remaining on stack is the resultant string.</p>
  
  <p>Auxillary space :O(n)  Complexity : O(n)</p>
  
  <p>Is this a correct solution and canyone explain the o(n) solution explained in the post?</p>