Test case 1 is not passing for LCS

Please help me with the following code for finding longest common substring.
Test case 1 is not passing

You have incorrect dp recurrence at line 22 which should be instead dp[i][j] = dp[i-1][j-1] +1;