Super Reduced String

  • + 0 comments
    def superReducedString(s):
        # Write your code here
        while re.search(r'([a-z])\1', s):
            s = re.sub(r'([a-z])\1', '', s)
        return 'Empty String' if len(s) == 0 else s