Created
September 29, 2016 16:44
-
-
Save ilpropheta/d53d27f9d3f867979ce0b1a4f6704778 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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