You are viewing a single comment's thread. Return to all comments →
C# solution
public static string superReducedString(string s) { string d,e; for(int i=0;i<s.Length-1;i++) { d= s.Substring(i, 1); e = s.Substring(i+1, 1); if (e == d) { s=s.Remove(i, 2); if (i == 0) i = i - 1; else i = i - 2; } } if (s.Length<1) { s="Empty String"; } return s; }
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 →
C# solution