C++ program to remove duplicates in a string using hash