You are viewing a single comment's thread. Return to all comments →
Super simple Python 2 solutions:
def removeRepeats(S): LS = list(S) i = 0 while i < len(LS)-1: if LS[i]==LS[i+1]: del LS[i] del LS[i] i = 0 if len(LS) == 0: print 'Empty String' break else: i+=1 return ''.join(LS)
Super Reduced String
You are viewing a single comment's thread. Return to all comments →
Super simple Python 2 solutions: