← All problemsSign in

Chef and Cakes

Chef is hungry, so he went to a market that has a single row of $N$ Cakeshops arranged from left to right. Every Cakeshop has some cakes. Chef wants to buy as many cakes as possible. However, the Cake Shop owners has some strict rules that Chef must follow: - You only have two bags and each bag can only hold a single type of cake. There is no limit on the amount of cake each bag can hold. - Start

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start