Clean easy to understand Java solution using Stack
\npublic boolean backspaceCompare(String S, String T) {\n\tString newS = resolve(S), newT = resolve(T);\n\treturn newS.equals(newT);\n}\n\npublic String resolve
```\npublic boolean backspaceCompare(String S, String T) {\n\tString newS = resolve(S), newT = resolve(T);\n\treturn newS.equals(newT);\n}\n\npublic String resolve(String str) {\n\tStack<Character> stack = new Stack<Character>();\n\tint i = 0;\n\twhile(i < str.length()) {\n\t\tif(str.charAt(i) == \'#\') {\n\t\t\tif(!stack.isEmpty())stack.pop();\n\t\t} else {\n\t\t\tstack.push(str.charAt(i));\n\t\t}\n\t\t\n\t\ti++;\n\t}\n\n    StringBuilder sb = new StringBuilder();\n\twhile(!stack.isEmpty()){\n\t\tsb.append(stack.pop());\n\t}\n\n\treturn sb.toString();\n}\n```
[]