Hello TA,
My code is giving right answers on sampl3e test cases and on some hidden test cases, but is given WA on some hidden test case, can you please help, that what exactly my doing wrong in my code!
CODE : https://ide.codingblocks.com/s/246466
All Hidden Test Cases are not Passing
Change line 18 to dp[i] = (dp[i] - dp[last[s[i-1]]]+MOD)%MOD;
1 Like
It worked. Thanks
Can you please tell that why we added that MOD thing again?
Itβs the basic property.
(a-b)%m=(a%m-b%m+m)%m;
1 Like
Oh. Okay. Thanks a lot!