string RemoveDuplicates(string str) { bool map[256] = {false}; string ret = ""; for (char c : str) { if (!map[c]) ret += c; map[c] = true; } return ret; }