Divisible subarrays

sir I do not understand the logic here! …please explain me because I have watched the video many times and I could not get it.
and the size of array was 5, do you make it as 6 and initialize the first element as 0 at index 0?

hello @mzk1994 what part of the code you haven’t understood.

thanks for your response
sir I understand till you reach the cumulative array %n and then you have used a formula (2c2)or something like that?
and sir the array size was 5 why does the size become 6 in the cumulative array and in cumulative array%n??

hello @mzk1994 yes right .
the size becomes 6 in the last step because there can be remainder from 0 to 6 any number could be there as a remainder between this range.
this is the reason.

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.