You are viewing a single comment's thread. Return to all comments →
def superReducedString(s): new_s = '' for i in range(len(s)): if not new_s: new_s += s[i] continue if new_s[-1]==s[i]: new_s = new_s[:-1] else: new_s += s[i] return new_s if new_s else '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 →