Sir for 3 test cases code is passing

but for test case no 4 and 5 it is saying something went wrong why??

@tejasddongare please share your code using CB IDE

Try initializing your array with 0 for each test case

i did still same issues

Are you getting a run-error or wrong answer?

You did not account for negative numbers

but my question is suppose if the after taking mod number is negative example -2
than should we increase the frequency in count array??? a[2]=a[2]+1 is it??

@tejasddongare for negative numbers take mod as
(a + n) % n instead of a%n

mam still code is not working why???
what is the issue now???

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.