DIY: Divide Chocolate
Explore how to solve a Facebook coding challenge that involves dividing a chocolate bar into pieces with maximum minimum sweetness. Learn to implement a Kotlin function that balances distribution among friends using array manipulation and optimization techniques.
We'll cover the following...
We'll cover the following...
Problem statement
You have one chocolate bar that consists of some chunks. Each chunk has its own sweetness given by the array sweetness.
You have K friends that you want to share the chocolate with. You cut the chocolate using K cuts and get K + 1 pieces, where ...