← All problemsSign in

Harry and stolen beans

Albus Dumbledore gifts Harry Potter with flavoured beans of different flavours. There are totally K different flavours of beans and Dumbledore picked a subset of these flavours. As he did not know Harry’s favourite flavour, he gives an equal number of beans of these flavours. He asks Crabbe and Goyle to pass them on to Harry. They decided to do some bongattam and eat some amount of candies from s

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