Missing one case in Find It problem

hello,
this is my code for Findit problem of number theory please guide me I am not able clear first test case
I think i m missing a corner case but I can’t find it please help

Remove this line
if(arr[j]>0)
And then try to submit. If it didn’t get accepted. Do let me know.

1 Like

after removing also its not getting accepted

test case 0 is not getting case 1&2 are accepted

Check now=>


Passing all test cases and have also commented your error.

1 Like

yess it passed all cases
but how the upper bound mentioned in the question was 10^5

Didn’t get you, please elaborate

1 Like

In the question the constrains where
1 <= N <= 10^5 1 <= numbers <= 10^5 1 <= Q <= 10^5 1 <= K <= 10^5
so why did you used 100005.

To avoid side case. Notice this whenever your mentor will code for this, he will use some extra space to avoid overflow. So it’s good to always use some extra space.

okk got it.
Thank you so much for your help :smiley:

Please Mark it as resolved

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.