23.04.05 Today’s Leetcode
2439. Minimize Maximum of Array (medium)
class Solution:
def minimizeArrayValue(self, nums: List[int]) -> int:
res = -1
temp, count = 0, 0
for i in range(len(nums)):
temp += nums[i]
count += 1
res = max(res, math.ceil(temp / count))
return res