Pattern of the Drunk
CodeChefOpen on judge ↗
Kabir has a very bad habit of alcohol. He drinks a lot, his friends tried to stop him but he got angry and left the home. While he was walking and drinking down the road, he entered into a hotel with N rooms. Since, kabir was too drunk, he started to open and close the door in a weird pattern. Say the doors are numbered from *1* to *N*, with the leftmost door numbered 1. If a door is opened, h
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