Cody

Problem 45404. ZigZag - 04

Given a matrix, print all its elements in the spiral form (clockwise direction).

For example,

 a=[16     2     3    13
     5    11    10     8
     9     7     6    12
     4    14    15     1]
output = [16 2 3 13 8 12 1 15 14 4 9 5 11 10 6 7] 

Solution Stats

35.29% Correct | 64.71% Incorrect
Last Solution submitted on Apr 19, 2020

Problem Comments

Problem Recent Solvers5

Suggested Problems

More from this Author145