File tree Expand file tree Collapse file tree 2 files changed +65
-2
lines changed Expand file tree Collapse file tree 2 files changed +65
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"exercise" : " saddle-points" ,
3
- "version" : " 1.2 .0" ,
3
+ "version" : " 1.3 .0" ,
4
4
"comments" : [
5
5
" Matrix rows and columns are 0-indexed."
6
6
],
117
117
"column" : 2
118
118
}
119
119
]
120
+ },
121
+ {
122
+ "description" : " Can identify saddle points in a non square matrix" ,
123
+ "property" : " saddlePoints" ,
124
+ "input" : {
125
+ "matrix" : [
126
+ [3 , 1 , 3 ],
127
+ [3 , 2 , 4 ]
128
+ ]
129
+ },
130
+ "expected" : [
131
+ {
132
+ "row" : 0 ,
133
+ "column" : 2
134
+ },
135
+ {
136
+ "row" : 0 ,
137
+ "column" : 0
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ "description" : " Can identify that saddle points in a single column matrix are those with the minimum value" ,
143
+ "property" : " saddlePoints" ,
144
+ "input" : {
145
+ "matrix" : [
146
+ [2 ],
147
+ [1 ],
148
+ [4 ],
149
+ [1 ]
150
+ ]
151
+ },
152
+ "expected" : [
153
+ {
154
+ "row" : 1 ,
155
+ "column" : 0
156
+ },
157
+ {
158
+ "row" : 3 ,
159
+ "column" : 0
160
+ }
161
+ ]
162
+ },
163
+ {
164
+ "description" : " Can identify that saddle points in a single row matrix are those with the maximum value" ,
165
+ "property" : " saddlePoints" ,
166
+ "input" : {
167
+ "matrix" : [
168
+ [2 , 5 , 3 , 5 ]
169
+ ]
170
+ },
171
+ "expected" : [
172
+ {
173
+ "row" : 0 ,
174
+ "column" : 1
175
+ },
176
+ {
177
+ "row" : 0 ,
178
+ "column" : 3
179
+ }
180
+ ]
120
181
}
121
182
]
122
- }
183
+ }
Original file line number Diff line number Diff line change @@ -21,5 +21,7 @@ A matrix may have zero or more saddle points.
21
21
Your code should be able to provide the (possibly empty) list of all the
22
22
saddle points for any given matrix.
23
23
24
+ The matrix can have a different number of rows and columns (Non square).
25
+
24
26
Note that you may find other definitions of matrix saddle points online,
25
27
but the tests for this exercise follow the above unambiguous definition.
You can’t perform that action at this time.
0 commit comments