Write a program to remove duplicate characters from a string.
MediumProblem Statement
Write a program to remove duplicate characters from a string.
Sample Input
std::string str = "programming";
Sample Output
String after removing duplicates: progamin
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
#include <iostream>
#include <string>
#include <unordered_set>
int main() {
std::string str = "programming";
// Logic to remove duplicates
return 0;
}
Input
std::string str = "programming";
Expected Output
String after removing duplicates: progamin