getSum(index, value)
that calculates the minimum sum of the array given nums[index] = value
.left = 1
and right = maxSum
.mid = (left + right + 1) // 2
.getSum(index, mid) <= maxSum
, set left = mid
.right = mid - 1
.left
as the maximum value for nums[index]
after the binary search ends.