You are viewing a single comment's thread. Return to all comments →
Here is my Python solution!
def superReducedString(s): s = list(s) change = True while change: change = False for letter in range(len(s) - 1): if letter < len(s) - 1: if s[letter] == s[letter + 1]: change = True s.pop(letter) s.pop(letter) if s: return "".join(s) 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 →
Here is my Python solution!