Square Spiral
CodeChefOpen on judge ↗
Chef is fond of attractive patterns and he likes to challenge himself to design creative patterns. This time he thought to write a piece of code which will print the pattern for him. Help Chef to complete his program. You are given an even integer $N$. Print $(N*2)+1$ lines of the pattern; that's how Chef wants it. For example, for $N=6$, the pattern will look like: #############
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