Super Reduced String
Solutions A solution changes the string by removing same adjacent elements.
Here is a C++ implementation:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #include <string> #include <iostream> #include <algorithm> using namespace std; int main() { string S; cin >> S; auto finder = [&]{ return adjacent_find(begin(S), end(S)); }; for (auto adjFind = finder(); adjFind != end(S); adjFind = finder()) { S.
[Read More]