Data Structures & AlgorithmsHardCodeforces Div2 D · LeetCode-style

The array [7, 2, 5, 10, 8, 3, 6] must be split into exactly 3 contiguous non-empty parts (order kept). What is the smallest possible value of the largest part sum?

  1. A. 17
  2. B. 24
  3. C. 13
  4. D. 10

Correct answer: A. 17

Binary search the cap: a cap is feasible when a greedy left-to-right split needs at most 3 parts. The largest element and the average are bounds, not answers, because parts must be contiguous.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic