Dvisible Subarrays

How to handle negative integers, which property of mod will be used to make it positive ?

hey @vky0018 since we are taking here mod with N so update your sum as sum+N and then take modulo.