We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aac74d1 commit 5064cc7Copy full SHA for 5064cc7
Sources/2022/08/TreetopTreeHouse.swift
@@ -189,9 +189,9 @@ extension TreetopTreeHouse
189
190
mutating func run() async throws
191
{
192
- let input = FileHandle.standardInput.bytes
193
- let rows : [[Int]] = try await input.lines.reduce(into: [[Int]]()) { $0.append($1.compactMap { Int(String($0))! }) }
194
- let columns : [[Int]] = rows[0].enumerated().map { rows[column: $0.0] }
+ let input : AsyncLineSequence = FileHandle.standardInput.bytes.lines
+ let rows : [[Int]] = try await input.reduce(into: [[Int]]()) { $0.append($1.integers) }
+ let columns : [[Int]] = rows[0].enumerated().map { rows[column: $0.0] }
195
196
switch self.mode
197
0 commit comments