here is the link https://ide.codingblocks.com/s/104068
Divisible subaarays runtime error
hey @ayush1213, you have to take the mod the check divisibility of that sub array. For more information, go through this video, prateek sir has expalined it very well https://www.youtube.com/watch?v=QQQpOa3aXew.
hey @ayush1213, sum=(sum+n)%n, this will ensure that negative of mod number will right answer too.
while this sum%=n; is must here.
hey @ayush1213, constraints are high in question, except t make everthing of type long long int.
Here is your updated code
hey @ayush1213 , if your query is resolved. Please mark this doubt as resolved and rate me on the basis of your experience.
rating option will appear when to mark this doubt as resolved