Remove duplicate characters in string

Write code to remove the duplicate characters in a string
without using any additional buffer NOTE: One or two additional variables are fine
An extra copy of the array is not.
This question is from the book “cracking thecoding interview”.

Time complexity= O(n^2)

Leave comment if you have any problem with code.
Recursive insertion sort

About Gaurav Vichare

Hi , I am Gaurav : author of this blog , Software engineer and a Photoshop lover . You can connect me on LinkedIn, cirlce me on Google or follow on Twitter

  • anjali

    i don’t think its the correct way to remove duplicate char..

    • Thanks for your comment.
      Can you explain where I am wrong? or give me test case when code fails!
      This program removes duplicate characters without using any extra variable!

  • sitaram

    nice coding…