Skip to content

Commit d5a7ab0

Browse files
authored
Update 1591-strange-printer-ii.js
1 parent 0b6acae commit d5a7ab0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

1591-strange-printer-ii.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ const isPrintable = function (targetGrid) {
1313
for (let j = 0; j < n; j++) {
1414
let c = targetGrid[i][j]
1515
colorSet.add(c)
16-
posMin[c][0] = Math.min(posMin[c][0], i) // Up
17-
posMin[c][1] = Math.min(posMin[c][1], j) // Left
18-
posMax[c][0] = Math.max(posMax[c][0], i) // Down
19-
posMax[c][1] = Math.max(posMax[c][1], j) // Right
16+
posMin[c][0] = Math.min(posMin[c][0], i) //Up
17+
posMin[c][1] = Math.min(posMin[c][1], j) //Left
18+
posMax[c][0] = Math.max(posMax[c][0], i) //Down
19+
posMax[c][1] = Math.max(posMax[c][1], j) //Right
2020
}
2121
}
22-
while (colorSet.size > 0) {
22+
while (colorSet.size) {
2323
const tmp = new Set()
2424
for (let color of colorSet) {
2525
if (!isRect(targetGrid, color)) {
@@ -45,6 +45,7 @@ const isPrintable = function (targetGrid) {
4545
A[i][j] = 0
4646
}
4747
}
48+
4849
return true
4950
}
5051
}

0 commit comments

Comments
 (0)