Unable to clear all testcases
please check, I have commented the code
hey, sry for delay…
consider a input which contains only one element
expected o/p is that single element only…
ur code gives 0…
Okay, will check where ur code is failing
hi, just tell which test case no is it failing on when u submit?
Teatcase 2 shows wrong ans
1<=N<=10^7
but u are restricting array size to int a[1000003]
so just write a[n], i think it should work…
Unable to clr testcase 1
sir, please help with the doubt
I checked the test case input… it’s failing for the case of n is very large and it contains all elements of same value…
so, what can we do abt that?
I am trying to figure out that, bcoz logic is correct only…
refer this once…
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.