We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Strings
- Super Reduced String
- Discussions
Super Reduced String
Super Reduced String
Sort by
recency
|
1732 Discussions
|
Please Login in order to post a comment
My simple C++ solution:
string superReducedString(string &s) { int i = 0; for ( i = 1; ( !s.empty() && i <= s.size() ); i++) { if ( s[i-1] == s[i]) { s.erase((i - 1), 2); i = 0; } } return s = (!s.empty()) ? s: "Empty String"; }
The C# code solution:
public static string superReducedString(string s) { List reduced = new List();
}
My Java 8 Solution