Remove Duplicate Characters from a String without creating a new one ?
Hello,
I have an interview with microsoft and they asked this question to like 3 other people so far.
How do you remove similar characters from a string without creating a new string and also making sure that it runs fast ? (not using a loop inside a loop and checking a million times)
What I mean is that how can you just remove duplicate characters and some how rearrange the string ?
"HELLO" should like like "HELO"
but you are allowed to create only one string or not declare another
Thanks,
JIgar
if someone can think of something then please reply or email me asap.
The problem is the same if u were to think of removing duplicates from an array without really creating another and without checking it with the unique array elements everytime.