Given an array of integers nums sorted in non-descending order and an integer k, return the number of distinct subarrays whose sum of elements is divisible by k.
A subarray is defined as a contiguous sequence of elements within an array. Two subarrays are distinct if the sequences of values they contain are not identical.
Constraints:
nums.length
nums[i]
nums is sorted in non-descending order.
k
Given an array of integers nums sorted in non-descending order and an integer k, return the number of distinct subarrays whose sum of elements is divisible by k.
A subarray is defined as a contiguous sequence of elements within an array. Two subarrays are distinct if the sequences of values they contain are not identical.
Constraints:
nums.length
nums[i]
nums is sorted in non-descending order.
k