[C++] Simple C++ Code
\n# If you like the implementation then Please help me by increasing my reputation. By clicking the up arrow on the left of my image.\n\nclass Solution {\npubli
\n# **If you like the implementation then Please help me by increasing my reputation. By clicking the up arrow on the left of my image.**\n```\nclass Solution {\npublic:\n    bool canChange(string start, string target) {\n        int end = target.size();\n        int ScntL = 0, ScntR = 0, TcntL = 0, TcntR = 0;\n        string ss = "", st = "";\n        for(int i = 0; i < end; i++)\n        {\n            if(start[i] != \'_\')\n                ss += start[i];\n            if(target[i] != \'_\')\n                st += target[i];\n        }\n        if(ss != st) return false;\n        for(int i = 0; i < end; i++)\n        {\n            if(start[i] == \'L\')\n                ScntL++;\n            if(target[i] == \'L\')\n                TcntL++;\n            if(ScntL > TcntL)\n                return false;\n        }\n        if(ScntL != TcntL)\n            return false;\n        for(int i = 0; i < end; i++)\n        {\n            if(start[i] == \'R\')\n                ScntR++;\n            if(target[i] == \'R\')\n                TcntR++;\n            if(ScntR < TcntR)\n                return false;\n        }\n        if(ScntR != TcntR)\n            return false;\n        return true;\n    }\n};\n```
['C', 'C++']