Add 2019 solutions
This commit is contained in:
parent
43a2ee8414
commit
4d5c8ee8ce
27 changed files with 3198 additions and 0 deletions
|
@ -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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue