Drunk in the night
CodeChefOpen on judge ↗
Yesterday night while walking under the street lights, Steve saw a drunk man. He was taking random steps. But there was something unique with his steps. He would either take a step North or South or East or West as if he was walking on a rectangular grid. After each step the drunk man selects one of the four directions and moves one step further in the selected direction. Assuming that there is a
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