File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ class Solution {
215
215
var x = 0 , y = 0 , p = 0
216
216
var black = Set < [Int ]> ()
217
217
var K = K
218
-
218
+
219
219
while K > 0 {
220
220
let t = [x, y]
221
221
if black.insert (t).inserted {
@@ -232,19 +232,19 @@ class Solution {
232
232
y2 = max (y2, y)
233
233
K -= 1
234
234
}
235
-
235
+
236
236
let m = x2 - x1 + 1
237
237
let n = y2 - y1 + 1
238
238
var g = Array (repeating : Array (repeating : " _" , count : n), count : m)
239
-
239
+
240
240
for t in black {
241
241
let i = t[0 ] - x1
242
242
let j = t[1 ] - y1
243
243
g[i][j] = " X"
244
244
}
245
-
245
+
246
246
g[x - x1][y - y1] = String (d[d.index (d.startIndex , offsetBy : p)])
247
-
247
+
248
248
return g.map { $0 .joined () }
249
249
}
250
250
}
Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ class Solution {
235
235
var x = 0 , y = 0 , p = 0
236
236
var black = Set < [Int ]> ()
237
237
var K = K
238
-
238
+
239
239
while K > 0 {
240
240
let t = [x, y]
241
241
if black.insert (t).inserted {
@@ -252,19 +252,19 @@ class Solution {
252
252
y2 = max (y2, y)
253
253
K -= 1
254
254
}
255
-
255
+
256
256
let m = x2 - x1 + 1
257
257
let n = y2 - y1 + 1
258
258
var g = Array (repeating : Array (repeating : " _" , count : n), count : m)
259
-
259
+
260
260
for t in black {
261
261
let i = t[0 ] - x1
262
262
let j = t[1 ] - y1
263
263
g[i][j] = " X"
264
264
}
265
-
265
+
266
266
g[x - x1][y - y1] = String (d[d.index (d.startIndex , offsetBy : p)])
267
-
267
+
268
268
return g.map { $0 .joined () }
269
269
}
270
270
}
You can’t perform that action at this time.
0 commit comments