You are viewing a single comment's thread. Return to all comments →
string str; cin >> str; int i=0; while(i < static_cast< int > (str.size()-1)) { if(i>-1 && str[i] == str[i+1]) { str.erase(i,2); i--; } else i++; } if(str.empty()) cout << "Empty String" << endl; else cout << str << endl;
Seems like cookies are disabled on this browser, please enable them to open this website
Super Reduced String
You are viewing a single comment's thread. Return to all comments →