The Ziggy-Zaggy Way
CodeChefOpen on judge ↗
Dorothy just realized that the yellow brick road isn't going to be an easy one. It's all zig-zag. Just to be safe, she decides to find out where she'll land at every step she takes. (1,1) (1,2) (1,3) (1,4) (1,5) ... (2,1) (2,2) (2,3) (2,4)... (3,1) (3,2) (3,3)... (4,1) (4,2)... (5,1)... . . In the above diagram, the first step is at (1,1), the second step is at (1,2), the third at (2,1), t
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