← All problemsSign in

Let’s Eat Candies

Riya has three piles of candies: red, green and blue candies: The first pile contains only red candies and there are r candies in it. The second pile contains only green candies and there are g candies in it. The third pile contains only blue candies and there are b candies in it. Each day Riya eats exactly two candies of different colors. She is free to choose the colors of eaten candies: th

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