Cody

Problem 44102. Stop a ZigZag scanning N*N Matrix at any diag you want

Suppose that we have a 2-D matrix and we try to obtain a 1-D array in zig-zag order, but not all values of our 2-D matrix e.g., for matrix

x= [1 2 3; 4 5 6; 7 8 9]

the resulting 1-D array should be

stop_zig(x,3)=[ 1 2 4 7 5 3]

stop_zig(x,1)=1

stop_zig(x,-1)=9

stop_zig(x,-2)=[9 8 6]

Solution Stats

76.47% Correct | 23.53% Incorrect
Last solution submitted on Jan 20, 2019

Problem Comments

Solution Comments

Recent Solvers9

Suggested Problems

More from this Author14

Tags