debug Traversal method

This commit is contained in:
2026-04-22 23:00:21 +03:30
parent 3e85586939
commit 2f72c0c8b6
+2
View File
@@ -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;