[Java] Intuitive logic O(N) time O(1) space [beats 100%]
\n    public boolean backspaceCompare(String S, String T) {\n        if (S.isEmpty() && T.isEmpty()) {\n            return true;\n        }\n        int i = S.l
```\n    public boolean backspaceCompare(String S, String T) {\n        if (S.isEmpty() && T.isEmpty()) {\n            return true;\n        }\n        int i = S.length() - 1;\n        int j = T.length() - 1;\n\n        while (true) {\n            i = applyBackSpace(S, i);\n            j = applyBackSpace(T, j);\n            if (i < 0 && j < 0) {\n                return true;\n            }\n            if (i < 0 || j < 0 || S.charAt(i--) != T.charAt(j--)) {\n                return false;\n            }\n        }\n    }\n\n    private int applyBackSpace(String str, int i) {\n        int count = 0;\n        while (i >= 0) {\n            if (str.charAt(i) == \'#\') {\n                count++;\n            } else if (count > 0) {\n                count--;\n            } else if (count == 0) {\n                break;\n            }\n            i--;\n        }\n        return i;\n    }\n```
[]