3512. Minimum Operations to Make Array Sum Divisible by K
You are given an integer array
numsand an integerk. You can perform the following operation any number of times:
- Select an index
iand replacenums[i]withnums[i] - 1.Return the minimum number of operations required to make the sum of the array divisible by
k.
1 | class Solution { |