Divisible Sub arrays

it is not passing all testcases i cant find why but it is passing the manual testcases which i made
this is my code

Hey @hrithik-1

Also

S%N==(S%N+0)%N == (S%N +N)%N this helps to avoid negative values of s

sir i think you have send something else by mistake .
i folllowed your suggestion but it is still showing one error in test case
i did this

		while(s<0)
			s+=n;
		sum[(s)%n]++;

it isnt the best way but it should give me the test case right

Hey @hrithik-1
Sorry for that
check this https://ide.codingblocks.com/s/393212

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.

sir
your code is still failing one testcase

I will check
… . … . . . .

Here

				count+=(long long)sum[i]*(sum[i]-1)/2;   // to avoid overflow on rhs since sum array is int type