Add 2019 solutions

This commit is contained in:
Sven Weidauer 2022-11-23 16:46:51 +01:00
parent 43a2ee8414
commit 4d5c8ee8ce
27 changed files with 3198 additions and 0 deletions

View file

@ -0,0 +1,23 @@
let min = 172930
let max = 683082
var count = 0
outer: for i in min...max {
let s = String(i).compactMap { $0.wholeNumberValue }
var hasDouble = false
for (first, second) in zip(s, s.dropFirst()) {
if second < first {
continue outer
}
if first == second {
hasDouble = true
}
}
guard hasDouble else { continue }
count += 1
}