Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilpropheta/d53d27f9d3f867979ce0b1a4f6704778 to your computer and use it in GitHub Desktop.
Save ilpropheta/d53d27f9d3f867979ce0b1a4f6704778 to your computer and use it in GitHub Desktop.
string S; cin >> S;
auto finder = [&]{
return adjacent_find(begin(S), end(S));
};
for (auto adjFind = finder(); adjFind != end(S); adjFind = finder())
{
S.erase(adjFind, adjFind + 2);
}
cout << (S.empty() ? "Empty String" : S);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment