Visitors to Chefland
CodeChefOpen on judge ↗
Chef had a function organized in Chefland where there were a row of N people seated one after the other. Out of them certain number of people were from Chefland and some were visitors. Chef wanted to arrange all the visitors in such a way that they all get to sit in contiguous chairs so that they are comfortable talking to each other. Chef can only change the seating arrangement by asking any two
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