Skip to content

Commit 3b40258

Browse files
yanglbmeidoocs
authored andcommitted
style: format code and docs with prettier
1 parent b1cf11c commit 3b40258

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lcci/16.22.Langtons Ant/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class Solution {
215215
var x = 0, y = 0, p = 0
216216
var black = Set<[Int]>()
217217
var K = K
218-
218+
219219
while K > 0 {
220220
let t = [x, y]
221221
if black.insert(t).inserted {
@@ -232,19 +232,19 @@ class Solution {
232232
y2 = max(y2, y)
233233
K -= 1
234234
}
235-
235+
236236
let m = x2 - x1 + 1
237237
let n = y2 - y1 + 1
238238
var g = Array(repeating: Array(repeating: "_", count: n), count: m)
239-
239+
240240
for t in black {
241241
let i = t[0] - x1
242242
let j = t[1] - y1
243243
g[i][j] = "X"
244244
}
245-
245+
246246
g[x - x1][y - y1] = String(d[d.index(d.startIndex, offsetBy: p)])
247-
247+
248248
return g.map { $0.joined() }
249249
}
250250
}

lcci/16.22.Langtons Ant/README_EN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ class Solution {
235235
var x = 0, y = 0, p = 0
236236
var black = Set<[Int]>()
237237
var K = K
238-
238+
239239
while K > 0 {
240240
let t = [x, y]
241241
if black.insert(t).inserted {
@@ -252,19 +252,19 @@ class Solution {
252252
y2 = max(y2, y)
253253
K -= 1
254254
}
255-
255+
256256
let m = x2 - x1 + 1
257257
let n = y2 - y1 + 1
258258
var g = Array(repeating: Array(repeating: "_", count: n), count: m)
259-
259+
260260
for t in black {
261261
let i = t[0] - x1
262262
let j = t[1] - y1
263263
g[i][j] = "X"
264264
}
265-
265+
266266
g[x - x1][y - y1] = String(d[d.index(d.startIndex, offsetBy: p)])
267-
267+
268268
return g.map { $0.joined() }
269269
}
270270
}

0 commit comments

Comments
 (0)