Return non-optional array up to the last int from integers()

This commit is contained in:
Sven Weidauer 2020-12-22 07:46:43 +01:00
parent 00d14b6e19
commit 81198be13a
4 changed files with 5 additions and 6 deletions

View file

@ -3,7 +3,7 @@ import Foundation
let input = loadData(day: 10)
let scanner = Scanner(string: input)
var adapters = scanner.integers()!.sorted { $0 > $1 }
var adapters = scanner.integers().sorted { $0 > $1 }
adapters.append(0)