Difference in explanation of logic and the code in this video lecture

While describing the recursive relation in the lecture, sir has explained and thus used the condition:

if( S1 [i] == S2 [j] )
then return 1+ f( S1, S2, i+1, j+1)
else{

but in his code he has used
if( S1 [i] == S2 [i] )
then return 1+ f( S1, S2, i+1, j+1)
else{

Notice the difference in the if statements.
And for this simple test case this pece of code seems to work, but is it correct and will it work for all the test cases?

hello @anshufirefox

in place of s2[i] it should be s2[j] . it was a typo.

Thank you for the clarification

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.