Hi, can anyone care to explain to me how the following code work? I got a code to basically to remove duplicate character but I do not understand how it work. Thanks!
I'll tell you the general algorithm. You can figure out how the code implements it.
Walk each character in the source string. If the character has already been added to the destination string,
then don't add it a second time, otherwise add it to the second string.