-
-
Notifications
You must be signed in to change notification settings - Fork 546
/
canonical-data.json
197 lines (197 loc) · 4.43 KB
/
canonical-data.json
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
187
188
189
190
191
192
193
194
195
196
197
{
"exercise": "saddle-points",
"comments": [
"Matrix rows and columns are 1-indexed.",
"The test cases list saddle points ordered by row ascending, then column ascending.",
"You can choose a different ordering logic and adjust the expected output accordingly,",
"or you can choose to skip asserting the order altogether."
],
"cases": [
{
"uuid": "3e374e63-a2e0-4530-a39a-d53c560382bd",
"description": "Can identify single saddle point",
"comments": ["This is the README example."],
"property": "saddlePoints",
"input": {
"matrix": [
[9, 8, 7],
[5, 3, 2],
[6, 6, 7]
]
},
"expected": [
{
"row": 2,
"column": 1
}
]
},
{
"uuid": "6b501e2b-6c1f-491f-b1bb-7f278f760534",
"description": "Can identify that empty matrix has no saddle points",
"property": "saddlePoints",
"input": {
"matrix": [
[]
]
},
"expected": []
},
{
"uuid": "8c27cc64-e573-4fcb-a099-f0ae863fb02f",
"description": "Can identify lack of saddle points when there are none",
"property": "saddlePoints",
"input": {
"matrix": [
[1, 2, 3],
[3, 1, 2],
[2, 3, 1]
]
},
"expected": []
},
{
"uuid": "6d1399bd-e105-40fd-a2c9-c6609507d7a3",
"description": "Can identify multiple saddle points in a column",
"property": "saddlePoints",
"input": {
"matrix": [
[4, 5, 4],
[3, 5, 5],
[1, 5, 4]
]
},
"expected": [
{
"row": 1,
"column": 2
},
{
"row": 2,
"column": 2
},
{
"row": 3,
"column": 2
}
]
},
{
"uuid": "3e81dce9-53b3-44e6-bf26-e328885fd5d1",
"description": "Can identify multiple saddle points in a row",
"property": "saddlePoints",
"input": {
"matrix": [
[6, 7, 8],
[5, 5, 5],
[7, 5, 6]
]
},
"expected": [
{
"row": 2,
"column": 1
},
{
"row": 2,
"column": 2
},
{
"row": 2,
"column": 3
}
]
},
{
"uuid": "88868621-b6f4-4837-bb8b-3fad8b25d46b",
"description": "Can identify saddle point in bottom right corner",
"comments": [
"This is a permutation of the README matrix designed to test",
"off-by-one errors."
],
"property": "saddlePoints",
"input": {
"matrix": [
[8, 7, 9],
[6, 7, 6],
[3, 2, 5]
]
},
"expected": [
{
"row": 3,
"column": 3
}
]
},
{
"uuid": "5b9499ca-fcea-4195-830a-9c4584a0ee79",
"description": "Can identify saddle points in a non square matrix",
"comments": [
"If your tests depend on the order of the saddle points,",
"note that this case breaks the sorting convention used in other cases (row ascending, column ascencding),",
"so you might want to swap the two points in the expected output."
],
"property": "saddlePoints",
"input": {
"matrix": [
[3, 1, 3],
[3, 2, 4]
]
},
"expected": [
{
"row": 1,
"column": 3
},
{
"row": 1,
"column": 1
}
]
},
{
"uuid": "ee99ccd2-a1f1-4283-ad39-f8c70f0cf594",
"description": "Can identify that saddle points in a single column matrix are those with the minimum value",
"property": "saddlePoints",
"input": {
"matrix": [
[2],
[1],
[4],
[1]
]
},
"expected": [
{
"row": 2,
"column": 1
},
{
"row": 4,
"column": 1
}
]
},
{
"uuid": "63abf709-a84b-407f-a1b3-456638689713",
"description": "Can identify that saddle points in a single row matrix are those with the maximum value",
"property": "saddlePoints",
"input": {
"matrix": [
[2, 5, 3, 5]
]
},
"expected": [
{
"row": 1,
"column": 2
},
{
"row": 1,
"column": 4
}
]
}
]
}