Marlabs interview question

Consider a program to remove duplicate characters