I was trying this problem from a competitive forum:Remove the repeated characters from the input string and output the  resulted string.Input string: abcabdOutput string: abcdThe minimum test cases are passed. Please provide your comments.string input = abcabd;string output;int len = input.length();for(int i=0; i<len;i++){    bool flag = false;    int len2 = output.length();    for(int j=0;j< len2;j++)    {        if(input[i]==output[j])        {            flag = true;            break;        }               }    if(!flag)    {        output = output + input[i];    }}cout << output.c_str() << endl;
Remove repeated characters
c++;algorithm;strings