Module Expr Str Assign NameStore Str ClassDef bases body FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Num Assign NameStore Num Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num Assign NameStore ListLoad Assign NameStore NameLoad For NameStore Call NameLoad BinOpMult NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad If NameLoad body If BoolOpOr CompareLt BinOpSub NameLoad Num Num CompareGtE BinOpAdd NameLoad Num NameLoad body Assign NameStore NameLoad If CompareGtE BinOpAdd NameLoad Num NameLoad body AugAssignAdd NameStore Num orelse AugAssignAdd NameStore Num orelse AugAssignSub NameStore Num AugAssignAdd NameStore Num orelse If BoolOpOr CompareGtE BinOpAdd NameLoad Num NameLoad CompareLt BinOpSub NameLoad Num Num body Assign NameStore NameLoad If CompareGtE BinOpAdd NameLoad Num NameLoad body AugAssignAdd NameStore Num orelse AugAssignAdd NameStore Num orelse AugAssignAdd NameStore Num AugAssignSub NameStore Num Return NameLoad decorator_list decorator_list If CompareEq NameLoad Str body Assign NameStore ListLoad ListLoad Num Num Num Num ListLoad Num Num Num Num ListLoad Num Num Num Num Print Call AttributeLoad Call NameLoad attr NameLoad
N/A N/A 
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in ZigZag-order

Example
Given a matrix:

[
  [1, 2,  3,  4],
  [5, 6,  7,  8],
  [9,10, 11, 12]
]
return [1, 2, 5, 9, 6, 3, 4, 7, 10, 11, 8, 12]
 N/A __author__ Daniel Solution N/A N/A printZMatrix N/A N/A self matrix N/A N/A N/A 

        :param matrix: a matrix of integers
        :return: a list of integers
         N/A i 0 N/A j 0 N/A m N/A len matrix N/A n N/A len N/A matrix N/A 0 N/A ret N/A N/A up True N/A _ N/A xrange N/A m n N/A N/A N/A N/A ret append N/A N/A matrix N/A i N/A j N/A up N/A N/A N/A N/A N/A i 1 0 N/A N/A j 1 n N/A N/A up False N/A N/A N/A j 1 n N/A N/A i 1 N/A N/A j 1 N/A N/A i 1 N/A j 1 N/A N/A N/A N/A N/A i 1 m N/A N/A j 1 0 N/A N/A up True N/A N/A N/A i 1 m N/A N/A j 1 N/A N/A i 1 N/A N/A i 1 N/A j 1 N/A ret N/A N/A N/A N/A __name__ __main__ N/A N/A matrix N/A N/A 1 2 3 4 N/A 5 6 7 8 N/A 9 10 11 12 N/A N/A N/A N/A Solution printZMatrix matrix