Hi,
I need some help in the following problem.
Given a circular buffer of integers (positive/negative), what is the minimum number of conversions (addition/subtraction by 1) on elements so that all K subarrays have the same sum. The cost of each conversion is 1.
Constraints:
- The input array represents a circular array.
- The numbers in the array can be positive or negative integers.
Example:
N = 10 (size of the array)
K = 1 (size of the subarrays)
array = [1,2,3,4,5,6,7,8,9,10]
Output is 25 (changing all the values to 5 satisfies the constraints)