Split Array Largest Sum
HardLeetCodeBinary Search on Answer
Approach hintTry it first, then revealHide
Binary search the largest allowed piece sum; a greedy pass that starts a new piece whenever the running sum would exceed it tells you how many pieces that limit needs.