You are viewing a single comment's thread. Return to all comments →
The C# code solution:
public static string superReducedString(string s) { List reduced = new List();
foreach(char c in s) { if(reduced.Count>0 && reduced[reduced.Count -1] ==c) { reduced.RemoveAt(reduced.Count-1); }else{ reduced.Add(c); } } if(reduced.Count==0) return "Empty String"; else return new string(reduced.ToArray()); }
}
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 →
The C# code solution:
public static string superReducedString(string s) { List reduced = new List();
}