Skip to content

Commit acb6410

Browse files
committed
Removed unncecessary check
1 parent 0ab3ee7 commit acb6410

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

src/main/java/org/dojo/leetcode/ArrayProblems.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -635,14 +635,10 @@ public List<Integer> spiralOrder(int[][] matrix) {
635635
if (left == right) break;
636636
for (int r = bottom - 1; r > top; r--) list.add(matrix[r][left]);
637637

638-
if (list.size() == m * n) break;
639-
640638
left++;
641639
right--;
642640
top++;
643641
bottom--;
644-
645-
if (right < 0 || left >= n || bottom < 0 || top >= m) break;
646642
}
647643

648644
return list;

0 commit comments

Comments
 (0)