Python | O(N) Time O(1) Space | Concise / Readable Solution using Generators
See melvinabraham\'s post for more details and an explanation. My solution is essentially the same, except that I\'ve used generators to get around most of the 
See [melvinabraham\'s](https://leetcode.com/problems/backspace-string-compare/discuss/585027/Python-O(N)-Time-O(1)-Space-Solution-or-Explained) post for more details and an explanation. My solution is essentially the same, except that I\'ve used generators to get around most of the bounds checking.\n\n```python\nclass Solution:\n    def backspaceCompare(self, s: str, t: str) -> bool:\n        def backwardResult(string):\n            debt = 0\n            \n            for c in reversed(string):\n                if c == \'#\':\n                    debt += 1\n                \n                elif debt > 0:\n                    debt -= 1\n                \n                else:\n                    yield c\n        \n        return all(a == b for (a, b) in zip_longest(backwardResult(s), backwardResult(t)))\n```
['Python3']