Print em all
CodeChefOpen on judge ↗
Observe the following patterns carefully. Pattern 2: Notice that numbers are being added either from top-left or bottom-right corner, alternatively. For $n = 5$ 1 3 7 13 21 4 8 14 22 17 9 15 23 18 10 16 24 19 11 5 25 20 12 6 2 Pattern 1: Notice that for each layer, the direction of number addition(clockwise - anticlockwise) changes. It will be clockwise for the outermost layer. For $n = 5$
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