🌻Well Explained C++ Easiest Solution || SC: O(1) || Fast and simple
Please Upvote if you like it :)\nApproach:  Two Pointer\n\nWe will make use of two pointers (i.e  i and j)  First pointer to traverse the string and second to s
**Please Upvote if you like it :)**\n**Approach:  Two Pointer**\n\nWe will make use of two pointers ***(i.e  i and j)***  First pointer to traverse the string and second to store the character given at that position.\n\n**Steps:**\n**1.** Start traversing the string by first pointer **i.e i**. if it is pointing to **#** then decrease the second pointer **i.e j** Make sure that **j** is always greater than or equals to 0 **(j>=0)** .And if it is not pointing to **#** then increase the second pointer **j** and store the element at **jth** position.  **s[j]=s[i]** continue the process until the string ends.\n\n**2.** We will do the same porcess with second string with its two pointers **i and k**.\n\n**3.** Now after traversing both the strings. If **j and k** are not equal then it means that the two strings have differnt length. If **j and k** are same, then compare elements of every index. \n\n**4.** if the two elements of the same index of both the string are different the return false.\n\n**Code:**\n\n```\nclass Solution {\npublic:\n    bool backspaceCompare(string s, string t) {\n        int j=0,k=0;\n        // for 1st string\n        for(int i=0;i<s.size();i++)\n        {\n           if(s[i]==\'#\')\n           {\n                j--;\n                j=max(0,j); // j will never be -ve\n           }\n           else\n           {\n               s[j]=s[i];\n               j++;\n           }\n        }\n        // for 2nd string\n        for(int i=0;i<t.size();i++)\n        {\n           if(t[i]==\'#\')\n           {\n                k--;\n                k=max(0,k); // k will never be -ve\n           }\n           else\n           {\n               t[k]=t[i];\n               k++;\n           }\n        }\n        if(j!=k) return false;\n        else\n        {\n            for(int i=0;i<k;i++)\n            {\n                if(s[i]!=t[i]) return false;\n            }\n            return true;\n        } \n    }\n};\n```\n\n**Upvote :)**
['C']