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 , future engineer and a Photoshop lover . You can connect with me on Facebook , cirlce me on Google or follow on Twitter

Comments

  1. 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!

  2. nice coding…

Speak Your Mind

*


+ five = 9

CommentLuv badge