FRUIT FINDER
CodeChefOpen on judge ↗
Chintu and Pintu are playing a game. In the middle of the game Sanjay arrives with a fruit basket. He picks some mangoes and bananas arranges them randomly and throws a challenge to find the number of mangoes within bananas. He will ask Q questions. For each questions he will give two numbers L and R. They have to find number of mangoes between extreme (leftmost and rightmost) bananas (inclusive)
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