Divide Chocolate

Try to solve the Divide Chocolate problem.

Statement

You have a chocolate bar made up of several chunks, and each chunk has a certain sweetness, given in an array called sweetness. You want to share the chocolate with k friends. To do that, you'll make k cuts to divide the bar into k + 1 parts. Each part will have chunks that are next to each other.

Being a kind person, you'll take the piece with the minimum total sweetness and give the other parts to your friends. Find and return the maximum possible minimum sweetness you can get if you cut the chocolate optimally.

Constraints:

  • 00 \leq ...