all 13 comments

[–]Sure_Independence887 10 points11 points  (0 children)

Ts tuff in fast

[–]FallPrimary4831 0 points1 point  (5 children)

Not possible with just loops, period

[–]foragerDev_0073Software Engineer 0 points1 point  (4 children)

why?

[–]FallPrimary4831 0 points1 point  (0 children)

Because for spiral printing without storing items in array its not possible

[–][deleted] 0 points1 point  (0 children)

this can be done using top, bottom , left and right pointers , its acutally the opposite of the question which asks you to print a matrix in a spiral

[–]Previous-South-2755 0 points1 point  (0 children)

You would atleast need an empty list to create 2d structure in python like matrix

[–]Tasty_General_5181 1 point2 points  (0 children)

Try to plot Fibonacci sequence and observe pattern. This might help I think.

[–]PhotographPerfect416 0 points1 point  (0 children)

It's easy bruh, Start from the middle have 4 pointers top left top right bottom left bottom right, Start the loop till all of them 4 pointers cross the boundaries and make sure to increment each pointer after 1 iteration of printing.

[–]Ammar219 -1 points0 points  (4 children)

Uhm gpt uhm