programming
progamin
void string_q12_remove_duplicates() {
string text = "programming";
string result = "";
bool seen[256] = {false};
cout << "Original: " << text << endl;
for(int i = 0; i < text.length(); i++) {
if(!seen[text[i]]) {
result += text[i];
seen[text[i]] = true;
}
}
cout << "After removing duplicates: " << result << endl;
}
void string_q12_remove_duplicates() {
string text = "programming";
string result = "";
bool seen[256] = {false};
cout << "Original: " << text << endl;
for(int i = 0; i < text.length(); i++) {
if(!seen[text[i]]) {
result += text[i];
seen[text[i]] = true;
}
}
cout << "After removing duplicates: " << result << endl;
}