POOH And His Chocolate Bar
CodeChefOpen on judge ↗
Pooh has a large chocolate bar with $n$ pieces. Each piece has its own chocolate value ranging from $1$ to $1000$. His friend keeps on making cuts on his chocolate bar and asks him to pick the connected component of the chocolate with the maximum chocolate content. The chocolate value of a connected component is the sum of all the chocolate value of the pieces lying in the connected component. Sin
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start