Hello friends, I have a doubt in question D)Catching Cheaters from Codeforces Round #683 (Div. 2, by Meet IT). Question link — https://codeforces.me/contest/1447/problem/D I did this question using dynamic programming with a recursive approach. In my solution https://codeforces.me/contest/1447/submission/98977433 ,verdict came as time limit exceeded but when I shifted line 14->17 two lines forward in my new solution https://codeforces.me/contest/1447/submission/98977715 which you can see in the dynamic function verdict came is accepted. The below shown is the portion which I shifted. int c1=-1; if(str1[a]==str2[b]){ c1=2+dynamic(a+1,b+1); } I am not able to find out the reason for this. I have been working on this since 2 days. So, I shall be thankful if someone helps me in this.








