You are viewing a single comment's thread. Return to all comments →
def super_reduced_string(s): if not s: return 'Empty String' stack = '' for i, c in enumerate(s): if stack and stack[-1] == c: stack = stack[:-1] else: stack += c if stack: return stack return '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 →