Easy to understand O(n) Time and O(1) Space solution (beats 100%)
The helper method will scan the string in reverse, returns next valid character and a index (This index can be used to scan for the next character). \n\nclass S
The helper method will scan the string in reverse, returns next valid character and a index (This index can be used to scan for the next character). \n```\nclass Solution(object):\n    def backspaceCompare(self, S, T):\n        """\n        :type S: str\n        :type T: str\n        :rtype: bool\n        """\n        def nextChar(string, pos):\n            i = pos\n            hashes = 0\n            while i >= 0:\n                if string[i] == \'#\':    # Count the number of hashes before scanning an alphabet\n                    hashes += 1\n                elif hashes > 0:        # Erase the alphabet and continue if any backspaces are scanned previously\n                    hashes -= 1\n                else:                   # All backspaces complimented, return the currently scanned character\n                    return string[i], i - 1\n                i -= 1\n            return "", i                # Reached the begining, return empty string\n        \n        i = len(S) - 1\n        j = len(T) - 1\n        while i >= 0  and j >= 0:\n            s, i = nextChar(S, i)\n            t, j = nextChar(T, j)\n            if s != t:\n                return False\n\n        # One of the strings was not completely scanned\n        if (i >= 0 and nextChar(S, i)[0]) or (j >= 0 and nextChar(T, j)[0]):\n            return False\n\t\t\n        # All characters scanned and both the streams are same\n        return True\n```
[]