You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Input: A = [4,5,0,-2,-3,1], K = 5
Output: 7
Explanation: There are 7 subarrays with a sum divisible by K = 5:
[4, 5, 0, -2, -3, 1], [5], [5, 0], [5, 0, -2, -3], [0], [0, -2, -3], [-2, -3]
Note
1 <= A.length <= 30000
-10000 <= A[i] <= 10000
2 <= K <= 10000
The text was updated successfully, but these errors were encountered:
974. Subarray Sums Divisible by K
给定一个整数数组
A
,返回其中元素之和可被K
整除的(连续、非空)子数组的数目。Example
Note
1 <= A.length <= 30000
-10000 <= A[i] <= 10000
2 <= K <= 10000
The text was updated successfully, but these errors were encountered: