Doubts regarding to divisible subarray problem

sir in divisible subarray problem me frequency of each sum ka concept samajh nhi aaya how frequency of each sum can find no. of subarrays

Hi @praveeng1234

so the logic is like

y axis shows sum between any 2 points in subarray

to basically
humne dekha ki agar after some interval the y axis ( sum ) value comes out to be the array
that means ki b/w those to points the sum is same
( -ve +ve add karke)
so we basically calculate no of pairs in the array equalling to the same value

which can be found using
m* ( m-1 ) /2

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.