debug Traversal method
This commit is contained in:
@@ -78,6 +78,8 @@ public class MainExercises
|
|||||||
int rows = matrix.length;
|
int rows = matrix.length;
|
||||||
int cols = matrix[0].length;
|
int cols = matrix[0].length;
|
||||||
|
|
||||||
|
if(rows == 1) return matrix[0];
|
||||||
|
|
||||||
int[] result = new int[rows * cols];
|
int[] result = new int[rows * cols];
|
||||||
|
|
||||||
int top = 0, bottom = rows - 1, left = 0, right = cols - 1;
|
int top = 0, bottom = rows - 1, left = 0, right = cols - 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user