Divisible subarray test case 1


it is not passing the test case no 1 i dont know why
can u please tell me an example where i am doing fault

hello @manthansrivastav1234 could you please share your code by saving it on ide.codingblocks.com .
i will check your code and tell you the error.

@manthansrivastav1234 try to make change in line 25 and run the loop
for(int i=0;i<=n;i++)
your loop should run till equal to n.
make this change and try to submit then.
Happy Learning!!

Hello @manthansrivastav1234 have you tried submitting it after submission?

yes it is done but where was the problem

because element cannot be 5 in frequency array

Hello @manthansrivastav1234 yes it can be because remainder can be ay number frim 0 to n that is not element but it is remainders upto n.
if you have any further doubt you can ask here:
Happy Learning!!

how can it be n suppose i have 5 as (5%5) will be zero only

can u please give me an example

Hello @manthansrivastav1234 there is no need to run for equal to n an yes the code which you have shared is passing all the test cases:


you can try to submit this code after refresh.
Happy Learning!!

ok i got that( https://ideone.com/QcICeU) can u please tell me what is the problrm with this code

@manthansrivastav1234
see this code:


you can now mark this doubt as resolved.
Happy Learning!!

ok i got that thanks

Hello @manthansrivastav1234 you can mark this doubt as resolved.
Happy Learning!!

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.