-
Notifications
You must be signed in to change notification settings - Fork 2
/
sudoku_v1.ts
187 lines (179 loc) · 12.8 KB
/
sudoku_v1.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
type Cell = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
export function sudoku<
X11 extends Cell,
X21 extends Cell,
X31 extends Cell,
X41 extends Cell,
X51 extends Cell,
X61 extends Cell,
X71 extends Cell,
X81 extends Cell,
X91 extends Cell,
X12 extends Cell,
X22 extends Cell,
X32 extends Cell,
X42 extends Cell,
X52 extends Cell,
X62 extends Cell,
X72 extends Cell,
X82 extends Cell,
X92 extends Cell,
X13 extends Cell,
X23 extends Cell,
X33 extends Cell,
X43 extends Cell,
X53 extends Cell,
X63 extends Cell,
X73 extends Cell,
X83 extends Cell,
X93 extends Cell,
X14 extends Cell,
X24 extends Cell,
X34 extends Cell,
X44 extends Cell,
X54 extends Cell,
X64 extends Cell,
X74 extends Cell,
X84 extends Cell,
X94 extends Cell,
X15 extends Cell,
X25 extends Cell,
X35 extends Cell,
X45 extends Cell,
X55 extends Cell,
X65 extends Cell,
X75 extends Cell,
X85 extends Cell,
X95 extends Cell,
X16 extends Cell,
X26 extends Cell,
X36 extends Cell,
X46 extends Cell,
X56 extends Cell,
X66 extends Cell,
X76 extends Cell,
X86 extends Cell,
X96 extends Cell,
X17 extends Cell,
X27 extends Cell,
X37 extends Cell,
X47 extends Cell,
X57 extends Cell,
X67 extends Cell,
X77 extends Cell,
X87 extends Cell,
X97 extends Cell,
X18 extends Cell,
X28 extends Cell,
X38 extends Cell,
X48 extends Cell,
X58 extends Cell,
X68 extends Cell,
X78 extends Cell,
X88 extends Cell,
X98 extends Cell,
X19 extends Cell,
X29 extends Cell,
X39 extends Cell,
X49 extends Cell,
X59 extends Cell,
X69 extends Cell,
X79 extends Cell,
X89 extends Cell,
X99 extends Cell,
>(grid:
[
Exclude<X11, X13 | X61 | X15 | X21 | X18 | X16 | X91 | X19 | X22 | X33 | X71 | X32 | X14 | X17 | X51 | X23 | X81 | X41 | X31 | X12>,
Exclude<X21, X13 | X61 | X11 | X91 | X22 | X33 | X71 | X26 | X32 | X29 | X27 | X25 | X51 | X24 | X23 | X81 | X41 | X31 | X12 | X28>,
Exclude<X31, X13 | X61 | X37 | X21 | X11 | X39 | X91 | X22 | X33 | X38 | X71 | X35 | X32 | X36 | X34 | X51 | X23 | X81 | X41 | X12>,
Exclude<X41, X61 | X43 | X52 | X42 | X21 | X45 | X44 | X49 | X11 | X48 | X91 | X46 | X71 | X53 | X63 | X62 | X51 | X47 | X81 | X31>,
Exclude<X51, X61 | X52 | X43 | X42 | X21 | X59 | X58 | X57 | X11 | X91 | X55 | X71 | X53 | X63 | X62 | X81 | X54 | X56 | X41 | X31>,
Exclude<X61, X52 | X43 | X42 | X21 | X66 | X11 | X91 | X64 | X67 | X71 | X53 | X69 | X63 | X62 | X51 | X65 | X68 | X81 | X41 | X31>,
Exclude<X71, X61 | X77 | X73 | X21 | X79 | X75 | X93 | X76 | X11 | X91 | X82 | X78 | X72 | X51 | X92 | X81 | X74 | X83 | X41 | X31>,
Exclude<X81, X61 | X73 | X21 | X93 | X11 | X84 | X91 | X82 | X85 | X89 | X87 | X71 | X88 | X72 | X51 | X92 | X86 | X83 | X41 | X31>,
Exclude<X91, X61 | X73 | X97 | X21 | X93 | X11 | X98 | X99 | X82 | X94 | X96 | X71 | X72 | X51 | X92 | X95 | X81 | X83 | X41 | X31>,
Exclude<X12, X13 | X52 | X42 | X15 | X21 | X18 | X16 | X11 | X19 | X22 | X82 | X33 | X32 | X14 | X72 | X62 | X17 | X23 | X92 | X31>,
Exclude<X22, X13 | X52 | X42 | X21 | X11 | X82 | X33 | X26 | X32 | X29 | X27 | X25 | X72 | X62 | X24 | X23 | X92 | X31 | X12 | X28>,
Exclude<X32, X13 | X52 | X42 | X37 | X21 | X11 | X39 | X22 | X82 | X33 | X38 | X35 | X36 | X34 | X72 | X62 | X23 | X92 | X31 | X12>,
Exclude<X42, X52 | X43 | X61 | X45 | X44 | X49 | X48 | X22 | X82 | X46 | X53 | X32 | X72 | X63 | X62 | X51 | X92 | X47 | X41 | X12>,
Exclude<X52, X61 | X43 | X42 | X59 | X58 | X57 | X55 | X22 | X82 | X53 | X32 | X72 | X63 | X62 | X51 | X92 | X54 | X56 | X41 | X12>,
Exclude<X62, X52 | X61 | X43 | X42 | X66 | X22 | X82 | X64 | X67 | X53 | X32 | X69 | X72 | X63 | X51 | X92 | X65 | X68 | X41 | X12>,
Exclude<X72, X52 | X42 | X77 | X73 | X79 | X75 | X93 | X76 | X91 | X22 | X82 | X71 | X32 | X78 | X62 | X92 | X81 | X74 | X83 | X12>,
Exclude<X82, X52 | X42 | X73 | X93 | X84 | X91 | X22 | X85 | X89 | X87 | X71 | X88 | X32 | X72 | X62 | X92 | X86 | X81 | X83 | X12>,
Exclude<X92, X52 | X42 | X73 | X97 | X93 | X98 | X99 | X91 | X22 | X82 | X94 | X96 | X71 | X32 | X72 | X62 | X95 | X81 | X83 | X12>,
Exclude<X13, X43 | X15 | X73 | X21 | X18 | X93 | X16 | X11 | X19 | X22 | X33 | X53 | X32 | X14 | X63 | X17 | X23 | X83 | X31 | X12>,
Exclude<X23, X13 | X43 | X73 | X21 | X93 | X11 | X22 | X33 | X53 | X26 | X32 | X29 | X27 | X25 | X63 | X24 | X83 | X31 | X12 | X28>,
Exclude<X33, X13 | X43 | X73 | X37 | X21 | X93 | X11 | X39 | X22 | X38 | X53 | X35 | X32 | X36 | X34 | X63 | X23 | X83 | X31 | X12>,
Exclude<X43, X13 | X61 | X52 | X42 | X73 | X45 | X44 | X49 | X93 | X48 | X46 | X33 | X53 | X63 | X62 | X51 | X23 | X47 | X83 | X41>,
Exclude<X53, X13 | X43 | X52 | X61 | X42 | X73 | X59 | X58 | X93 | X57 | X55 | X33 | X63 | X62 | X51 | X23 | X54 | X83 | X56 | X41>,
Exclude<X63, X13 | X43 | X61 | X52 | X42 | X73 | X66 | X93 | X64 | X33 | X67 | X53 | X69 | X62 | X51 | X23 | X65 | X68 | X83 | X41>,
Exclude<X73, X13 | X43 | X77 | X79 | X93 | X75 | X76 | X91 | X82 | X33 | X53 | X71 | X78 | X63 | X72 | X23 | X92 | X81 | X83 | X74>,
Exclude<X83, X13 | X43 | X73 | X93 | X84 | X91 | X82 | X85 | X33 | X89 | X87 | X53 | X71 | X88 | X63 | X72 | X23 | X92 | X86 | X81>,
Exclude<X93, X13 | X43 | X73 | X97 | X98 | X99 | X91 | X82 | X94 | X33 | X96 | X53 | X71 | X63 | X72 | X23 | X92 | X95 | X81 | X83>,
Exclude<X14, X13 | X15 | X18 | X44 | X16 | X11 | X84 | X19 | X64 | X94 | X26 | X35 | X36 | X34 | X25 | X17 | X24 | X54 | X74 | X12>,
Exclude<X24, X15 | X21 | X44 | X16 | X84 | X22 | X64 | X94 | X26 | X35 | X14 | X29 | X27 | X36 | X34 | X25 | X23 | X54 | X74 | X28>,
Exclude<X34, X15 | X37 | X44 | X16 | X39 | X84 | X64 | X94 | X33 | X38 | X35 | X26 | X32 | X14 | X36 | X25 | X24 | X54 | X74 | X31>,
Exclude<X44, X43 | X42 | X45 | X66 | X49 | X84 | X48 | X55 | X64 | X46 | X94 | X14 | X34 | X24 | X47 | X65 | X54 | X74 | X56 | X41>,
Exclude<X54, X52 | X45 | X66 | X59 | X44 | X58 | X57 | X84 | X55 | X64 | X46 | X94 | X53 | X14 | X34 | X24 | X51 | X65 | X74 | X56>,
Exclude<X64, X61 | X45 | X66 | X44 | X84 | X55 | X46 | X94 | X67 | X14 | X69 | X34 | X63 | X62 | X24 | X65 | X68 | X54 | X74 | X56>,
Exclude<X74, X77 | X73 | X79 | X44 | X75 | X76 | X84 | X64 | X94 | X85 | X96 | X71 | X14 | X78 | X34 | X72 | X24 | X86 | X95 | X54>,
Exclude<X84, X44 | X75 | X76 | X64 | X82 | X94 | X85 | X89 | X87 | X96 | X88 | X14 | X34 | X24 | X86 | X95 | X54 | X81 | X74 | X83>,
Exclude<X94, X97 | X44 | X93 | X75 | X76 | X98 | X99 | X84 | X91 | X64 | X85 | X96 | X14 | X34 | X24 | X92 | X95 | X86 | X54 | X74>,
Exclude<X15, X13 | X45 | X18 | X75 | X16 | X11 | X55 | X19 | X85 | X35 | X26 | X14 | X36 | X25 | X34 | X17 | X24 | X65 | X95 | X12>,
Exclude<X25, X15 | X21 | X45 | X75 | X16 | X55 | X22 | X85 | X35 | X26 | X14 | X29 | X27 | X36 | X34 | X24 | X23 | X65 | X95 | X28>,
Exclude<X35, X15 | X37 | X45 | X75 | X16 | X39 | X55 | X85 | X33 | X38 | X26 | X32 | X14 | X36 | X25 | X34 | X24 | X65 | X95 | X31>,
Exclude<X45, X43 | X15 | X42 | X66 | X44 | X49 | X75 | X48 | X55 | X46 | X64 | X85 | X35 | X25 | X65 | X47 | X95 | X54 | X56 | X41>,
Exclude<X55, X52 | X15 | X45 | X66 | X59 | X44 | X58 | X75 | X57 | X46 | X64 | X85 | X35 | X53 | X25 | X51 | X65 | X95 | X54 | X56>,
Exclude<X65, X61 | X15 | X45 | X66 | X44 | X75 | X55 | X64 | X46 | X85 | X67 | X35 | X69 | X25 | X63 | X62 | X95 | X68 | X54 | X56>,
Exclude<X75, X15 | X77 | X73 | X45 | X79 | X76 | X84 | X55 | X85 | X94 | X96 | X35 | X71 | X78 | X25 | X72 | X65 | X95 | X86 | X74>,
Exclude<X85, X15 | X45 | X75 | X76 | X84 | X55 | X82 | X94 | X89 | X87 | X96 | X35 | X88 | X25 | X65 | X95 | X86 | X81 | X83 | X74>,
Exclude<X95, X15 | X97 | X45 | X75 | X93 | X76 | X98 | X99 | X84 | X55 | X91 | X85 | X94 | X96 | X35 | X25 | X65 | X92 | X86 | X74>,
Exclude<X16, X13 | X15 | X18 | X66 | X76 | X11 | X19 | X46 | X96 | X26 | X35 | X14 | X36 | X25 | X34 | X17 | X24 | X86 | X56 | X12>,
Exclude<X26, X15 | X21 | X66 | X76 | X16 | X22 | X46 | X96 | X35 | X14 | X29 | X36 | X27 | X25 | X34 | X24 | X23 | X86 | X56 | X28>,
Exclude<X36, X15 | X37 | X66 | X76 | X16 | X39 | X46 | X33 | X38 | X96 | X26 | X35 | X32 | X14 | X34 | X25 | X24 | X86 | X56 | X31>,
Exclude<X46, X43 | X42 | X45 | X66 | X44 | X49 | X76 | X16 | X48 | X55 | X64 | X96 | X26 | X36 | X47 | X65 | X86 | X54 | X56 | X41>,
Exclude<X56, X52 | X45 | X66 | X59 | X44 | X58 | X57 | X76 | X16 | X55 | X46 | X64 | X96 | X26 | X53 | X36 | X51 | X65 | X86 | X54>,
Exclude<X66, X61 | X45 | X44 | X76 | X16 | X55 | X46 | X64 | X67 | X96 | X26 | X36 | X69 | X63 | X62 | X65 | X86 | X68 | X54 | X56>,
Exclude<X76, X77 | X73 | X79 | X66 | X75 | X16 | X84 | X46 | X85 | X94 | X96 | X26 | X71 | X36 | X78 | X72 | X86 | X95 | X56 | X74>,
Exclude<X86, X66 | X75 | X76 | X16 | X84 | X46 | X82 | X85 | X94 | X89 | X96 | X87 | X26 | X88 | X36 | X95 | X81 | X56 | X83 | X74>,
Exclude<X96, X97 | X66 | X93 | X75 | X76 | X16 | X98 | X99 | X84 | X91 | X46 | X94 | X85 | X26 | X36 | X92 | X86 | X95 | X56 | X74>,
Exclude<X17, X13 | X15 | X77 | X37 | X97 | X18 | X57 | X16 | X11 | X39 | X19 | X38 | X67 | X87 | X14 | X29 | X27 | X47 | X12 | X28>,
Exclude<X27, X77 | X37 | X97 | X21 | X18 | X57 | X39 | X19 | X22 | X38 | X67 | X87 | X26 | X29 | X25 | X17 | X24 | X23 | X47 | X28>,
Exclude<X37, X77 | X97 | X18 | X57 | X39 | X19 | X33 | X38 | X67 | X87 | X35 | X32 | X29 | X27 | X36 | X34 | X17 | X47 | X31 | X28>,
Exclude<X47, X43 | X42 | X77 | X37 | X97 | X45 | X59 | X44 | X49 | X58 | X57 | X48 | X46 | X67 | X87 | X27 | X69 | X17 | X68 | X41>,
Exclude<X57, X52 | X77 | X37 | X97 | X59 | X58 | X49 | X48 | X55 | X67 | X87 | X53 | X27 | X69 | X17 | X51 | X47 | X68 | X54 | X56>,
Exclude<X67, X61 | X77 | X37 | X97 | X66 | X59 | X49 | X58 | X57 | X48 | X64 | X87 | X27 | X69 | X63 | X17 | X62 | X47 | X65 | X68>,
Exclude<X77, X37 | X73 | X97 | X79 | X57 | X75 | X76 | X98 | X99 | X89 | X67 | X87 | X71 | X88 | X27 | X78 | X72 | X17 | X47 | X74>,
Exclude<X87, X77 | X37 | X97 | X79 | X57 | X98 | X99 | X84 | X82 | X85 | X89 | X67 | X88 | X27 | X78 | X17 | X47 | X86 | X81 | X83>,
Exclude<X97, X77 | X37 | X79 | X57 | X93 | X98 | X99 | X91 | X94 | X89 | X67 | X87 | X96 | X88 | X27 | X78 | X17 | X47 | X92 | X95>,
Exclude<X18, X13 | X15 | X37 | X58 | X16 | X11 | X98 | X39 | X48 | X19 | X38 | X88 | X14 | X29 | X27 | X78 | X17 | X68 | X12 | X28>,
Exclude<X28, X37 | X21 | X18 | X58 | X98 | X39 | X48 | X19 | X22 | X38 | X26 | X88 | X29 | X27 | X78 | X25 | X17 | X24 | X23 | X68>,
Exclude<X38, X37 | X18 | X58 | X98 | X39 | X48 | X19 | X33 | X35 | X88 | X32 | X29 | X36 | X27 | X78 | X34 | X17 | X68 | X31 | X28>,
Exclude<X48, X43 | X42 | X18 | X45 | X59 | X44 | X58 | X49 | X57 | X98 | X46 | X38 | X67 | X88 | X78 | X69 | X47 | X68 | X41 | X28>,
Exclude<X58, X52 | X18 | X59 | X49 | X57 | X98 | X48 | X55 | X38 | X67 | X53 | X88 | X78 | X69 | X51 | X47 | X68 | X54 | X56 | X28>,
Exclude<X68, X61 | X18 | X66 | X59 | X58 | X49 | X57 | X98 | X48 | X64 | X38 | X67 | X88 | X78 | X69 | X63 | X62 | X65 | X47 | X28>,
Exclude<X78, X77 | X73 | X97 | X18 | X79 | X58 | X75 | X76 | X98 | X99 | X48 | X38 | X89 | X87 | X71 | X88 | X72 | X68 | X74 | X28>,
Exclude<X88, X77 | X97 | X18 | X79 | X58 | X98 | X99 | X48 | X84 | X82 | X85 | X38 | X89 | X87 | X78 | X68 | X86 | X81 | X83 | X28>,
Exclude<X98, X77 | X97 | X18 | X79 | X58 | X93 | X99 | X48 | X91 | X94 | X38 | X89 | X96 | X87 | X88 | X78 | X92 | X68 | X95 | X28>,
Exclude<X19, X13 | X15 | X37 | X18 | X79 | X59 | X49 | X16 | X11 | X99 | X39 | X38 | X89 | X14 | X29 | X27 | X69 | X17 | X12 | X28>,
Exclude<X29, X37 | X21 | X18 | X79 | X59 | X49 | X99 | X39 | X19 | X22 | X38 | X89 | X26 | X27 | X69 | X25 | X17 | X24 | X23 | X28>,
Exclude<X39, X37 | X18 | X79 | X59 | X49 | X99 | X19 | X33 | X38 | X89 | X35 | X32 | X29 | X36 | X27 | X69 | X34 | X17 | X31 | X28>,
Exclude<X49, X43 | X42 | X45 | X79 | X59 | X44 | X58 | X57 | X99 | X39 | X48 | X19 | X46 | X89 | X67 | X29 | X69 | X47 | X68 | X41>,
Exclude<X59, X52 | X79 | X49 | X58 | X57 | X99 | X39 | X48 | X19 | X55 | X89 | X67 | X53 | X29 | X69 | X51 | X47 | X68 | X54 | X56>,
Exclude<X69, X61 | X79 | X66 | X59 | X49 | X58 | X57 | X99 | X39 | X48 | X19 | X64 | X89 | X67 | X29 | X63 | X62 | X65 | X47 | X68>,
Exclude<X79, X77 | X73 | X97 | X59 | X49 | X75 | X76 | X98 | X99 | X39 | X19 | X89 | X87 | X71 | X88 | X29 | X69 | X78 | X72 | X74>,
Exclude<X89, X77 | X97 | X79 | X59 | X49 | X98 | X99 | X39 | X84 | X19 | X82 | X85 | X87 | X88 | X29 | X69 | X78 | X86 | X81 | X83>,
Exclude<X99, X77 | X97 | X79 | X59 | X49 | X93 | X98 | X39 | X19 | X91 | X94 | X89 | X96 | X87 | X88 | X29 | X69 | X78 | X92 | X95>,
]
) {}
sudoku([
7, 9, 2, 3, 5, 4, 6, 1, 8,
8, 5, 4, 1, 2, 6, 3, 9, 7,
3, 6, 1, 9, 8, 7, 5, 2, 4,
9, 4, 5, 6, 3, 8, 1, 7, 2,
2, 7, 8, 5, 4, 1, 9, 3, 6,
6, 1, 3, 7, 9, 2, 8, 4, 5,
4, 2, 9, 8, 1, 5, 7, 6, 3,
1, 8, 7, 2, 6, 3, 4, 5, 9,
5, 3, 6, 4, 7, 9, 2, 8, 1,
])