0974. Subarray Sums Divisible by K
https://leetcode.com/problems/subarray-sums-divisible-by-k
Description
Given an integer array nums
and an integer k
, return the number of non-empty subarrays that have a sum divisible by k
.
A subarray is a contiguous part of an array.
Example 1:
Example 2:
Constraints:
1 <= nums.length <= 3 * 104
-104 <= nums[i] <= 104
2 <= k <= 104
ac
Last updated