Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cstring>
- using namespace std;
- string newUniqueStr(string str)
- {
- int arr[255] = { 0 };
- for (int i = 0; i < str.size(); ++i)
- ++arr[static_cast<int>(str[i])];
- string newStr = "";
- for (int i = 0; i < 255; ++i)
- if (arr[i] == 1)
- newStr += static_cast<char>(i);
- return newStr;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement