kotlin faster than 99.40% with extra space O(1)
\n\nclass Solution {\n    fun backspaceCompare(s: String, t: String): Boolean {\n        \n        var i = s.length - 1\n        var j = t.length - 1\n        v
![image](https://assets.leetcode.com/users/images/c998bb61-1d46-472d-902d-75149305fc77_1664807165.71374.png)\n```\nclass Solution {\n    fun backspaceCompare(s: String, t: String): Boolean {\n        \n        var i = s.length - 1\n        var j = t.length - 1\n        var back: Int\n        \n        while (true) {\n            back = 0\n            while (i >= 0 && (back > 0 || s[i] == \'#\')) {\n                back += if (s[i] == \'#\') 1 else -1\n                i--\n            }\n            \n            back = 0\n            while (j >= 0 && (back > 0 || t[j] == \'#\')) {\n                back += if (t[j] == \'#\') 1 else -1\n                j--\n            }\n            \n            if (i >= 0 && j >= 0 && s[i] == t[j]) {\n                i--\n                j--\n            } else {\n                break\n            }\n            \n        }\n        \n        return i == -1 && j == -1\n        \n    }\n}\n```
['Kotlin']