Some testcase failing in DIVISIBLE SUBARRAYS problem

Here is my code please review my code , and help me understand my mistake

@mehul.narendra.dubey

sun
calculate your sum as this, since sum can be large negative number so adding just n won’t make it positive so first take modulo then adding n will make it positive.

thank you very much @sdevwrat

1 Like