From 4e3252636a80862c9fd9ed879a0e1edf6cdeea52 Mon Sep 17 00:00:00 2001 From: Stuart Kent Date: Sun, 16 Apr 2017 21:13:55 -0400 Subject: [PATCH] saddle-points: add canonical data --- exercises/saddle-points/canonical-data.json | 84 +++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 exercises/saddle-points/canonical-data.json diff --git a/exercises/saddle-points/canonical-data.json b/exercises/saddle-points/canonical-data.json new file mode 100644 index 0000000000..fdd4774d5d --- /dev/null +++ b/exercises/saddle-points/canonical-data.json @@ -0,0 +1,84 @@ +{ + "exercise": "saddle-points", + "version": "1.0.0", + "comments": [ + "Matrix rows and columns are 0-indexed." + ], + "cases": [ + { + "description": "Can identify single saddle point (README example)", + "property": "saddlePoints", + "input": [ + [9, 8, 7], + [5, 3, 2], + [6, 6, 7] + ], + "expected": [ + { + "row": 1, + "column": 0 + } + ] + }, + { + "description": "Can identify that empty matrix has no saddle points", + "property": "saddlePoints", + "input": [ + [] + ], + "expected": [] + }, + { + "description": "Can identify lack of saddle points when there are none", + "property": "saddlePoints", + "input": [ + [1, 2, 3], + [3, 1, 2], + [2, 3, 1] + ], + "expected": [] + }, + { + "description": "Can identify multiple saddle points", + "property": "saddlePoints", + "input": [ + [4, 5, 4], + [3, 5, 5], + [1, 5, 4] + ], + "expected": [ + { + "row": 0, + "column": 1 + }, + { + "row": 1, + "column": 1 + }, + { + "row": 2, + "column": 1 + } + ] + }, + { + "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": [ + [8, 7, 9], + [6, 7, 6], + [3, 2, 5] + ], + "expected": [ + { + "row": 2, + "column": 2 + } + ] + } + ] +} \ No newline at end of file