why it is showing wrong ans in test case 3 and 4 but showing correct in all other cases
my code is in coding blocks ide
code no : 139618
name : random query
Wa in some test cases
Hi
Can you please explain little about your logic
(I think this equation is wrong.)
(just this part. :
f1(i,sz-1){
dp[i+1]=dp[i]+(i+1-prevind[v[i+1]]);
prevind[v[i+1]]=i+1;
}
}
your recursive equation ?
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.