Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,17 @@
let res = [2, 4, 6].map({x in
return (1...7)
.filter({ $0 != x })
.map({y -> (Int, Int, Int)? in
let z = 12 - (x + y)
guard y != z && 1 <= z && z <= 7 else {
return nil
}
return (x, y, z)
}).compactMap({ $0 })
}).flatMap({ $0 })
for result in res {
print(result)
}

View file

@ -0,0 +1,17 @@
var res = [(Int, Int, Int)]()
for x in [2, 4, 6] {
for y in 1...7 where x != y {
let z = 12 - (x + y)
guard y != z && 1 <= z && z <= 7 else {
continue
}
res.append((x, y, z))
}
}
for result in res {
print(result)
}