Python: Easy to understand solution
Every time we encounter a valid char, add it to the list.  Every time we encounter a backspace (#), remove the last char that was added to the list.  Compare th
Every time we encounter a valid char, add it to the list.  Every time we encounter a backspace (#), remove the last char that was added to the list.  Compare the resulting list for both strings S and T to get the final answer.\n```python\nclass Solution:\n    def backspaceCompare(self, S, T):\n        def bsString(string):\n            res = []\n            for c in string:\n                if c != \'#\':\n                    res.append(c)\n                else:\n                    res = res[:-1]\n            return res\n\n        """\n        :type S: str\n        :type T: str\n        :rtype: bool\n        """\n        return bsString(S) == bsString(T)\n```
[]