could anybody please make me understand why bhaiya haven’t build the cumulative sum array and take the first element of the prefix array as 1 and how the sum of null subarray is going to be 1.
Divisible subarrays under number theory
ultimately we need the frequency array so if we can directly make freq array then it is space optimised
in this question we need cum sum at each index not the array for cumulative sum so we use only single variable
as freq of 0 is always one
so we take first element of array as 1
i hope this helps
if yes hit a like and don’t forgot to mark doubt as resolved 
if you have more doubts regarding this feel free to ask
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.