← All problemsSign in

2439. Minimize Maximum of Array

LeetCodeArrayBinary SearchDynamic ProgrammingGreedyPrefix SumOpen on judge ↗

You are given a 0-indexed array nums comprising of n non-negative integers. In one operation, you must: - Choose an integer i such that 1 <= i < n and nums[i] > 0. - Decrease nums[i] by 1. - Increase nums[i - 1] by 1. Return the minimum possible value of the maximum integer of nums after performing any number of operations. Example 1: Input: nums = [3,7,1,6] Output: 5 Explanation: One set

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start