In the code implementation shown in the video of divisible subarrays, why we have not written if condition that frequency of sum should be greater than 1 then only it will be a good sub array , before computing the number of good sub arrays (using m*(m-1)/2 or mC2 formula)
Divisible subarrays
If m is 0 or 1 then the value from formula will become 0 and it won’t be added so you don’t need an additional condition
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.