You are viewing a single comment's thread. Return to all comments →
even simpler:
def super_reduced_string(s): r = [] for c in s: last = r.pop() if r else "" if c != last: r.extend([last, c]) return "".join(r) or "Empty String"
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 →
even simpler: