it is not passing all testcases i cant find why but it is passing the manual testcases which i made
this is my code
Divisible Sub arrays
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
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