← All problemsSign in

ROOMS

Ishan and his friends have decide to join College. After joining they decided to look for hostels. The hostel consist of n rooms in row some of which are occupied. Ishan and his $m$ friends plan to take rooms . Ishan decided to book $m+1$ rooms which are unoccupied for him and his friends. He wants all his friends to have a room close to him , so he wants to minimize the maximum distance from hi

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