1231. Divide Chocolate
https://leetcode.com/problems/divide-chocolate
Description
You have one chocolate bar that consists of some chunks. Each chunk has its own sweetness given by the array sweetness
.
You want to share the chocolate with your k
friends so you start cutting the chocolate bar into k + 1
pieces using k
cuts, each piece consists of some consecutive chunks.
Being generous, you will eat the piece with the minimum total sweetness and give the other pieces to your friends.
Find the maximum total sweetness of the piece you can get by cutting the chocolate bar optimally.
Example 1:
Example 2:
Example 3:
Constraints:
0 <= k < sweetness.length <= 104
1 <= sweetness[i] <= 105
ac
Last updated