Python Solution , Memory usage BEATS ~ 97%
In this code we compare the current value with the previous value .\nFor better understanding remove the "#" commented part .\n\nclass Solution:\n    def remove
In this code we compare the current value with the previous value .\nFor better understanding remove the "#" commented part .\n```\nclass Solution:\n    def removeDuplicates(self, s: str) -> str:\n        first=1\n        last=len(s)\n        while(first<last):\n            if(s[first]==s[first-1]):\n                s=s.replace(s[first-1:first+1],"")\n                if(first>1):\n                    first=first-1\n            else:\n                first+=1\n            last=len(s)\n\t\t\t#print(s,first,last)\n        return(s)\n```\nIf u understood the code then plz...UPVOTE
['Python']