Skip to content

Commit 730403f

Browse files
authored
Merge pull request #46 from bitlux/dev
Add solution for GC9CKM0
2 parents 5cf5ebb + b6303fc commit 730403f

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

gc9ckm0_the_secret_network/main.go

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
)
6+
7+
func uniq(ints ...int) bool {
8+
m := map[int]bool{}
9+
for _, n := range ints {
10+
if _, ok := m[n]; ok {
11+
return false
12+
}
13+
m[n] = true
14+
}
15+
return true
16+
}
17+
18+
func main() {
19+
for a := 1; a <= 20; a++ {
20+
for b := 1; b <= 20; b++ {
21+
for c := 1; c <= 20; c++ {
22+
for d := 1; d <= 20; d++ {
23+
for e := 1; e <= 20; e++ {
24+
if b+c+d+e != 26 { // A
25+
continue
26+
}
27+
for f := 18; f <= 20; f++ {
28+
if a+d+f != 33 { // B
29+
continue
30+
}
31+
for g := 1; g <= 20; g++ {
32+
if a+d+g != 21 { // C
33+
continue
34+
}
35+
for h := 1; h <= 20; h++ {
36+
if c+d+h != 15 { // G
37+
continue
38+
}
39+
for i := 18; i <= 20; i++ {
40+
if f+i != 38 { // J
41+
continue
42+
}
43+
if g+i != 26 { // H
44+
continue
45+
}
46+
if a+b+c+g+i != 52 { // D
47+
continue
48+
}
49+
if a+f+i != 45 { // E
50+
continue
51+
}
52+
for j := 1; j <= 20; j++ {
53+
if b+e+j != 35 { // F
54+
continue
55+
}
56+
if d+e+h+j != 31 { // I
57+
continue
58+
}
59+
if !uniq(a, b, c, d, e, f, g, h, i, j) {
60+
continue
61+
}
62+
fmt.Printf("%c%c%c%c%c%c%c%c%c%c\n", a+64, b+64, c+64, d+64, e+64, f+64, g+64, h+64, i+64, j+64)
63+
}
64+
}
65+
}
66+
}
67+
}
68+
}
69+
}
70+
}
71+
}
72+
}
73+
}

0 commit comments

Comments
 (0)