← All problemsSign in

revenue

A student named snehith is working on the Revenue of all the countries across the world. He has C countries in his list. There are N cities have Revenue R along with the country number C. His task is to select M cities from the cities which belong to the same country and find the minimum value i.e difference of maximum revenue -minimum revenue of selected M cities. Likewise, find minimum value as

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