EASY JAVA SOLUTION USING STACK
\nclass Solution {\n    public boolean backspaceCompare(String s, String t) {\n        \n        Stack<Character> stk1 = new Stack<>();\n        Stack<Character
```\nclass Solution {\n    public boolean backspaceCompare(String s, String t) {\n        \n        Stack<Character> stk1 = new Stack<>();\n        Stack<Character> stk2 = new Stack<>();\n\n        for (int i = 0; i < s.length(); i++) {\n            if (s.charAt(i) != \'#\') {\n                stk1.add(s.charAt(i));\n            }\n            else {\n                if (!stk1.isEmpty())\n                    stk1.pop();\n            }\n        }\n\n        for (int i = 0; i < t.length(); i++) {\n            if (t.charAt(i) != \'#\') {\n                stk2.add(t.charAt(i));\n            }\n            else {\n                if (!stk2.isEmpty())\n                    stk2.pop();\n            }\n        }\n\n        boolean flag = true;\n\n        if (stk1.size() != stk2.size()) {\n            return false;\n        }\n\n        if (stk1.isEmpty() && stk2.isEmpty()) {\n            return true;\n        }\n\n        while (!stk1.isEmpty() && !stk2.isEmpty()) {\n\n            if (stk1.pop() == stk2.pop()) {\n                flag =  true;\n            }\n            else {\n                flag = false;\n                break;\n            }\n        }\n        return flag;\n    }\n}\n```
['Stack', 'Java']