← All problemsSign in

Chef and Game of Picking Sticks

Chef Hari is a curious little chef in Cheftown. He asks his father lots of questions about various dishes. One day, his father created a game for him and asked him to play it so that he can understand logics in a better way. In this game, there is a single straight line segment spanning from 0 to M. There are N sticks lying on this segment. Left and right ends of stick i are at Li and Ri respecti

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