Python stack based solution beats 97.07% in runtime and 98.54% in memory usage
I solved this problem by creating lists that behaved like stacks, corresponding to each input string. I iterated through each character in each string, and if I
I solved this problem by creating lists that behaved like stacks, corresponding to each input string. I iterated through each character in each string, and if I ran into a \'#\', I popped from the corresponding list if it was not empty. At the end, I compared the two lists.\n```\nclass Solution(object):\n    def backspaceCompare(self, S, T):\n        s = []\n        t = []\n        for c in S:\n            if c == \'#\':\n                if s != []:\n                    s.pop()\n            else:\n                s.append(c)\n        for c in T:\n            if c == \'#\':\n                if t != []:\n                    t.pop()\n            else:\n                t.append(c)\n        return s == t\n        """\n        :type S: str\n        :type T: str\n        :rtype: bool\n        """\n```
['Stack', 'Python']