C++ | Need Help in Debugging | 43 / 55 test cases passed
\tMy solution got Wrong Answer for this test case i don\'t know where i\'m doing wrong\n\ti have looked for atmost 3hrs+ to debugging this solution but didn\'t 
\tMy solution got Wrong Answer for this test case i don\'t know where i\'m doing wrong\n\ti have looked for atmost 3hrs+ to debugging this solution but didn\'t find the problem\n\tanyone can plese help me\n\n\tclass Solution {\n\tpublic:\n\t\tvector<int> lpsEvil;\n\n\t\tint state[501][51][2][2];\n\t\tint mod = 1e9 + 7;\n\t\tstring s, t, evil;\n\n\t\tint solve(int sPos, int evilPos, bool fSame, bool sSame){\n\t\t\tif(evilPos == evil.size()) return 0;\n\t\t\tif(sPos == s.size()) return 1;\n\n\t\t\tif(state[sPos][evilPos][fSame][sSame] != -1) return state[sPos][evilPos][fSame][sSame];\n\n\t\t\tchar start = fSame ? s[sPos] : \'a\';\n\t\t\tchar end = sSame ? t[sPos] : \'z\';\n\n\t\t\tint res = 0;\n\t\t\tfor(auto c = start; c <= end; c++){\n\n\t\t\t\tauto tmp = evilPos;\n\t\t\t\twhile(tmp > 0 && c != evil[tmp]) tmp = lpsEvil[tmp - 1];\n\t\t\t\tif(c == evil[tmp]) tmp++;\n\n\t\t\t\tres = (res + solve(sPos + 1, tmp, fSame & (c == s[sPos]), sSame & (c == t[sPos]))) % mod;\n\t\t\t}\n\n\t\t\treturn state[sPos][evilPos][fSame][sSame] = res;\n\n\t\t}\n\t\tint findGoodStrings(int n, string s1, string s2, string evil) {\n\n\t\t\tlpsEvil.resize(evil.size(), 0);\n\t\t\tmemset(state, -1, sizeof(state));\n\n\t\t\tthis -> evil = evil;\n\t\t\ts = s1; t = s2;\n\n\t\t\tint len = 0;\n\t\t\tfor(auto i = 1; i < evil.size(); ){\n\t\t\t\tif(evil[i] == evil[len]){\n\t\t\t\t\tevil[i++] = ++len;\n\t\t\t\t}else{\n\t\t\t\t\tif(len) len = lpsEvil[len - 1];\n\t\t\t\t\telse i++;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\treturn solve(0, 0, 1, 1);\n\t\t}\n\t};\n\n----------------------\n\tTEST CASE Which Lead to WA\n\t\n\t93\n\t"kazxkmmctdgtrplfggliycskmbfzjkrsthahcrxaaylpdykqfyejwteexytvxgjrbviconioomfpznawsseisfcpfkuvx"\n\t"lajtokckoizywvirjhccouuhjkkshdtzchzmiccujzpeqzcvfekdqjgrbkzrwfnfwhyvzrrrakiausbleeimmthaqqouh"\n\t"kpvphwnkrtxuiuhb"
[]