Could anyone please explain the question to me, and also the expression for difference, it says 1N/2 what does that mean?
Dividing array, question not clear
lets say at position i and j (i<j) we have the same modulus of prefix array.
now we see that from i+1 pos to jth position , the cumulative mod off array should be zero.
why?
see from 0 to i cumulative mod=k and from 0 to j cumulative mod =k, if we subract these two, cumulative mod will be 0 , i.e. from i+1 to k modulus will be zero. so for all pairs of such i and j , the answer will exist , threfore we take Nc2 of total count to count all such pairs.
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.
Got it! Thank you Bhaiya!