trackler 2.0.8.16 → 2.0.8.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/common/exercises/alphametics/canonical-data.json +100 -44
- data/common/exercises/anagram/canonical-data.json +3 -3
- data/common/exercises/beer-song/canonical-data.json +75 -47
- data/common/exercises/binary-search/canonical-data.json +86 -74
- data/common/exercises/bowling/canonical-data.json +1 -1
- data/common/exercises/bracket-push/canonical-data.json +15 -0
- data/common/exercises/circular-buffer/canonical-data.json +16 -1
- data/common/exercises/connect/canonical-data.json +19 -7
- data/common/exercises/custom-set/canonical-data.json +287 -246
- data/common/exercises/dominoes/canonical-data.json +125 -111
- data/common/exercises/flatten-array/canonical-data.json +35 -28
- data/common/exercises/food-chain/canonical-data.json +196 -182
- data/common/exercises/gigasecond/canonical-data.json +51 -41
- data/common/exercises/isogram/canonical-data.json +59 -38
- data/common/exercises/pangram/canonical-data.json +69 -47
- data/common/exercises/perfect-numbers/canonical-data.json +3 -3
- data/common/exercises/phone-number/canonical-data.json +74 -55
- data/common/exercises/sum-of-multiples/canonical-data.json +88 -62
- data/lib/trackler/version.rb +1 -1
- data/tracks/elixir/docs/INSTALLATION.md +2 -0
- data/tracks/elixir/docs/LEARNING.md +2 -0
- data/tracks/elixir/docs/RESOURCES.md +8 -0
- data/tracks/groovy/docs/ABOUT.md +1 -1
- data/tracks/groovy/docs/LEARNING.md +5 -4
- data/tracks/groovy/docs/RESOURCES.md +8 -1
- data/tracks/rust/exercises/hello-world/GETTING_STARTED.md +29 -97
- metadata +1 -1
@@ -1,67 +1,82 @@
|
|
1
1
|
{
|
2
|
+
"exercise": "bracket-push",
|
3
|
+
"version": "1.0.0",
|
2
4
|
"cases": [
|
3
5
|
{
|
4
6
|
"description": "paired square brackets",
|
7
|
+
"property": "isPaired",
|
5
8
|
"input": "[]",
|
6
9
|
"expected": true
|
7
10
|
},
|
8
11
|
{
|
9
12
|
"description": "empty string",
|
13
|
+
"property": "isPaired",
|
10
14
|
"input": "",
|
11
15
|
"expected": true
|
12
16
|
},
|
13
17
|
{
|
14
18
|
"description": "unpaired brackets",
|
19
|
+
"property": "isPaired",
|
15
20
|
"input": "[[",
|
16
21
|
"expected": false
|
17
22
|
},
|
18
23
|
{
|
19
24
|
"description": "wrong ordered brackets",
|
25
|
+
"property": "isPaired",
|
20
26
|
"input": "}{",
|
21
27
|
"expected": false
|
22
28
|
},
|
23
29
|
{
|
24
30
|
"description": "paired with whitespace",
|
31
|
+
"property": "isPaired",
|
25
32
|
"input": "{ }",
|
26
33
|
"expected": true
|
27
34
|
},
|
28
35
|
{
|
29
36
|
"description": "simple nested brackets",
|
37
|
+
"property": "isPaired",
|
30
38
|
"input": "{[]}",
|
31
39
|
"expected": true
|
32
40
|
},
|
33
41
|
{
|
34
42
|
"description": "several paired brackets",
|
43
|
+
"property": "isPaired",
|
35
44
|
"input": "{}[]",
|
36
45
|
"expected": true
|
37
46
|
},
|
38
47
|
{
|
39
48
|
"description": "paired and nested brackets",
|
49
|
+
"property": "isPaired",
|
40
50
|
"input": "([{}({}[])])",
|
41
51
|
"expected": true
|
42
52
|
},
|
43
53
|
{
|
44
54
|
"description": "unopened closing brackets",
|
55
|
+
"property": "isPaired",
|
45
56
|
"input": "{[)][]}",
|
46
57
|
"expected": false
|
47
58
|
},
|
48
59
|
{
|
49
60
|
"description": "unpaired and nested brackets",
|
61
|
+
"property": "isPaired",
|
50
62
|
"input": "([{])",
|
51
63
|
"expected": false
|
52
64
|
},
|
53
65
|
{
|
54
66
|
"description": "paired and wrong nested brackets",
|
67
|
+
"property": "isPaired",
|
55
68
|
"input": "[({]})",
|
56
69
|
"expected": false
|
57
70
|
},
|
58
71
|
{
|
59
72
|
"description": "math expression",
|
73
|
+
"property": "isPaired",
|
60
74
|
"input": "(((185 + 223.85) * 15) - 543)/2",
|
61
75
|
"expected": true
|
62
76
|
},
|
63
77
|
{
|
64
78
|
"description": "complex latex expression",
|
79
|
+
"property": "isPaired",
|
65
80
|
"input": "\\left(\\begin{array}{cc} \\frac{1}{3} & x\\\\ \\mathrm{e}^{x} &... x^2 \\end{array}\\right)",
|
66
81
|
"expected": true
|
67
82
|
}
|
@@ -1,5 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"
|
2
|
+
"exercise": "circular-buffer",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"comments": [
|
3
5
|
"In general, these circular buffers are expected to be stateful,",
|
4
6
|
"and each language will operate on them differently.",
|
5
7
|
"Tests tend to perform a series of operations, some of which expect a certain result.",
|
@@ -25,6 +27,7 @@
|
|
25
27
|
"cases": [
|
26
28
|
{
|
27
29
|
"description": "reading empty buffer should fail",
|
30
|
+
"property": "run",
|
28
31
|
"capacity": 1,
|
29
32
|
"operations": [
|
30
33
|
{
|
@@ -35,6 +38,7 @@
|
|
35
38
|
},
|
36
39
|
{
|
37
40
|
"description": "can read an item just written",
|
41
|
+
"property": "run",
|
38
42
|
"capacity": 1,
|
39
43
|
"operations": [
|
40
44
|
{
|
@@ -51,6 +55,7 @@
|
|
51
55
|
},
|
52
56
|
{
|
53
57
|
"description": "each item may only be read once",
|
58
|
+
"property": "run",
|
54
59
|
"capacity": 1,
|
55
60
|
"operations": [
|
56
61
|
{
|
@@ -71,6 +76,7 @@
|
|
71
76
|
},
|
72
77
|
{
|
73
78
|
"description": "items are read in the order they are written",
|
79
|
+
"property": "run",
|
74
80
|
"capacity": 2,
|
75
81
|
"operations": [
|
76
82
|
{
|
@@ -97,6 +103,7 @@
|
|
97
103
|
},
|
98
104
|
{
|
99
105
|
"description": "full buffer can't be written to",
|
106
|
+
"property": "run",
|
100
107
|
"capacity": 1,
|
101
108
|
"operations": [
|
102
109
|
{
|
@@ -113,6 +120,7 @@
|
|
113
120
|
},
|
114
121
|
{
|
115
122
|
"description": "a read frees up capacity for another write",
|
123
|
+
"property": "run",
|
116
124
|
"capacity": 1,
|
117
125
|
"operations": [
|
118
126
|
{
|
@@ -139,6 +147,7 @@
|
|
139
147
|
},
|
140
148
|
{
|
141
149
|
"description": "read position is maintained even across multiple writes",
|
150
|
+
"property": "run",
|
142
151
|
"capacity": 3,
|
143
152
|
"operations": [
|
144
153
|
{
|
@@ -175,6 +184,7 @@
|
|
175
184
|
},
|
176
185
|
{
|
177
186
|
"description": "items cleared out of buffer can't be read",
|
187
|
+
"property": "run",
|
178
188
|
"capacity": 1,
|
179
189
|
"operations": [
|
180
190
|
{
|
@@ -193,6 +203,7 @@
|
|
193
203
|
},
|
194
204
|
{
|
195
205
|
"description": "clear frees up capacity for another write",
|
206
|
+
"property": "run",
|
196
207
|
"capacity": 1,
|
197
208
|
"operations": [
|
198
209
|
{
|
@@ -217,6 +228,7 @@
|
|
217
228
|
},
|
218
229
|
{
|
219
230
|
"description": "clear does nothing on empty buffer",
|
231
|
+
"property": "run",
|
220
232
|
"capacity": 1,
|
221
233
|
"operations": [
|
222
234
|
{
|
@@ -236,6 +248,7 @@
|
|
236
248
|
},
|
237
249
|
{
|
238
250
|
"description": "overwrite acts like write on non-full buffer",
|
251
|
+
"property": "run",
|
239
252
|
"capacity": 2,
|
240
253
|
"operations": [
|
241
254
|
{
|
@@ -261,6 +274,7 @@
|
|
261
274
|
},
|
262
275
|
{
|
263
276
|
"description": "overwrite removes the oldest item on full buffer",
|
277
|
+
"property": "run",
|
264
278
|
"capacity": 2,
|
265
279
|
"operations": [
|
266
280
|
{
|
@@ -291,6 +305,7 @@
|
|
291
305
|
},
|
292
306
|
{
|
293
307
|
"description": "overwrite doesn't remove an already-read item",
|
308
|
+
"property": "run",
|
294
309
|
"capacity": 3,
|
295
310
|
"operations": [
|
296
311
|
{
|
@@ -1,7 +1,10 @@
|
|
1
1
|
{
|
2
|
+
"exercise": "connect",
|
3
|
+
"version": "1.0.0",
|
2
4
|
"cases": [
|
3
5
|
{
|
4
6
|
"description": "an empty board has no winner",
|
7
|
+
"property": "winner",
|
5
8
|
"board": [
|
6
9
|
". . . . .",
|
7
10
|
" . . . . .",
|
@@ -13,6 +16,7 @@
|
|
13
16
|
},
|
14
17
|
{
|
15
18
|
"description": "X can win on a 1x1 board",
|
19
|
+
"property": "winner",
|
16
20
|
"board": [
|
17
21
|
"X"
|
18
22
|
],
|
@@ -20,6 +24,7 @@
|
|
20
24
|
},
|
21
25
|
{
|
22
26
|
"description": "O can win on a 1x1 board",
|
27
|
+
"property": "winner",
|
23
28
|
"board": [
|
24
29
|
"O"
|
25
30
|
],
|
@@ -27,6 +32,7 @@
|
|
27
32
|
},
|
28
33
|
{
|
29
34
|
"description": "only edges does not make a winner",
|
35
|
+
"property": "winner",
|
30
36
|
"board": [
|
31
37
|
"O O O X",
|
32
38
|
" X . . X",
|
@@ -37,6 +43,7 @@
|
|
37
43
|
},
|
38
44
|
{
|
39
45
|
"description": "illegal diagonal does not make a winner",
|
46
|
+
"property": "winner",
|
40
47
|
"board": [
|
41
48
|
"X O . .",
|
42
49
|
" O X X X",
|
@@ -48,17 +55,19 @@
|
|
48
55
|
},
|
49
56
|
{
|
50
57
|
"description": "nobody wins crossing adjacent angles",
|
58
|
+
"property": "winner",
|
51
59
|
"board": [
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
60
|
+
"X . . .",
|
61
|
+
" . X O .",
|
62
|
+
" O . X O",
|
63
|
+
" . O . X",
|
64
|
+
" . . O ."
|
57
65
|
],
|
58
66
|
"expected": ""
|
59
67
|
},
|
60
68
|
{
|
61
69
|
"description": "X wins crossing from left to right",
|
70
|
+
"property": "winner",
|
62
71
|
"board": [
|
63
72
|
". O . .",
|
64
73
|
" O X X X",
|
@@ -70,6 +79,7 @@
|
|
70
79
|
},
|
71
80
|
{
|
72
81
|
"description": "O wins crossing from top to bottom",
|
82
|
+
"property": "winner",
|
73
83
|
"board": [
|
74
84
|
". O . .",
|
75
85
|
" O X X X",
|
@@ -81,17 +91,19 @@
|
|
81
91
|
},
|
82
92
|
{
|
83
93
|
"description": "X wins using a convoluted path",
|
94
|
+
"property": "winner",
|
84
95
|
"board": [
|
85
96
|
". X X . .",
|
86
97
|
" X . X . X",
|
87
98
|
" . X . X .",
|
88
99
|
" . X X . .",
|
89
100
|
" O O O O O"
|
90
|
-
],
|
101
|
+
],
|
91
102
|
"expected": "X"
|
92
103
|
},
|
93
104
|
{
|
94
105
|
"description": "X wins using a spiral path",
|
106
|
+
"property": "winner",
|
95
107
|
"board": [
|
96
108
|
"O X X X X X X X X",
|
97
109
|
" O X O O O O O O O",
|
@@ -106,4 +118,4 @@
|
|
106
118
|
"expected": "X"
|
107
119
|
}
|
108
120
|
]
|
109
|
-
}
|
121
|
+
}
|
@@ -1,277 +1,318 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
2
|
+
"exercise": "custom-set",
|
3
|
+
"version": "1.0.1",
|
4
|
+
"comments": [
|
5
|
+
"These tests cover the core components of a set data structure: checking",
|
6
|
+
"presence, adding, comparing and basic set operations. Other features",
|
7
|
+
"such as deleting elements, checking size, sorting are not tested, but",
|
8
|
+
"you can add them if they are interesting in your language",
|
9
|
+
"",
|
10
|
+
"Tests about mixed-type sets are not included because the ability",
|
11
|
+
"to implement that will vary by language. If your language supports it",
|
12
|
+
"and you want to implement mixed-type sets, feel free."
|
13
|
+
],
|
14
|
+
"cases": [
|
15
|
+
{
|
16
|
+
"description": "Returns true if the set contains no elements",
|
17
|
+
"cases": [
|
18
|
+
{
|
16
19
|
"description": "sets with no elements are empty",
|
20
|
+
"property": "empty",
|
17
21
|
"set": [],
|
18
22
|
"expected": true
|
19
|
-
|
20
|
-
|
23
|
+
},
|
24
|
+
{
|
21
25
|
"description": "sets with elements are not empty",
|
26
|
+
"property": "empty",
|
22
27
|
"set": [1],
|
23
28
|
"expected": false
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
29
|
+
}
|
30
|
+
]
|
31
|
+
},
|
32
|
+
{
|
28
33
|
"description": "Sets can report if they contain an element",
|
29
34
|
"cases": [
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
35
|
+
{
|
36
|
+
"description": "nothing is contained in an empty set",
|
37
|
+
"property": "contains",
|
38
|
+
"set": [],
|
39
|
+
"element": 1,
|
40
|
+
"expected": false
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"description": "when the element is in the set",
|
44
|
+
"property": "contains",
|
45
|
+
"set": [1, 2, 3],
|
46
|
+
"element": 1,
|
47
|
+
"expected": true
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"description": "when the element is not in the set",
|
51
|
+
"property": "contains",
|
52
|
+
"set": [1, 2, 3],
|
53
|
+
"element": 4,
|
54
|
+
"expected": false
|
55
|
+
}
|
48
56
|
]
|
49
|
-
|
50
|
-
|
57
|
+
},
|
58
|
+
{
|
51
59
|
"description": "A set is a subset if all of its elements are contained in the other set",
|
52
60
|
"cases": [
|
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
|
-
|
61
|
+
{
|
62
|
+
"description": "empty set is a subset of another empty set",
|
63
|
+
"property": "subset",
|
64
|
+
"set1": [],
|
65
|
+
"set2": [],
|
66
|
+
"expected": true
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"description": "empty set is a subset of non-empty set",
|
70
|
+
"property": "subset",
|
71
|
+
"set1": [],
|
72
|
+
"set2": [1],
|
73
|
+
"expected": true
|
74
|
+
},
|
75
|
+
{
|
76
|
+
"description": "non-empty set is not a subset of empty set",
|
77
|
+
"property": "subset",
|
78
|
+
"set1": [1],
|
79
|
+
"set2": [],
|
80
|
+
"expected": false
|
81
|
+
},
|
82
|
+
{
|
83
|
+
"description": "set is a subset of set with exact same elements",
|
84
|
+
"property": "subset",
|
85
|
+
"set1": [1, 2, 3],
|
86
|
+
"set2": [1, 2, 3],
|
87
|
+
"expected": true
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"description": "set is a subset of larger set with same elements",
|
91
|
+
"property": "subset",
|
92
|
+
"set1": [1, 2, 3],
|
93
|
+
"set2": [4, 1, 2, 3],
|
94
|
+
"expected": true
|
95
|
+
},
|
96
|
+
{
|
97
|
+
"description": "set is not a subset of set that does not contain its elements",
|
98
|
+
"property": "subset",
|
99
|
+
"set1": [1, 2, 3],
|
100
|
+
"set2": [4, 1, 3],
|
101
|
+
"expected": false
|
102
|
+
}
|
89
103
|
]
|
90
|
-
|
91
|
-
|
104
|
+
},
|
105
|
+
{
|
92
106
|
"description": "Sets are disjoint if they share no elements",
|
93
107
|
"cases": [
|
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
|
-
|
108
|
+
{
|
109
|
+
"description": "the empty set is disjoint with itself",
|
110
|
+
"property": "disjoint",
|
111
|
+
"set1": [],
|
112
|
+
"set2": [],
|
113
|
+
"expected": true
|
114
|
+
},
|
115
|
+
{
|
116
|
+
"description": "empty set is disjoint with non-empty set",
|
117
|
+
"property": "disjoint",
|
118
|
+
"set1": [],
|
119
|
+
"set2": [1],
|
120
|
+
"expected": true
|
121
|
+
},
|
122
|
+
{
|
123
|
+
"description": "non-empty set is disjoint with empty set",
|
124
|
+
"property": "disjoint",
|
125
|
+
"set1": [1],
|
126
|
+
"set2": [],
|
127
|
+
"expected": true
|
128
|
+
},
|
129
|
+
{
|
130
|
+
"description": "sets are not disjoint if they share an element",
|
131
|
+
"property": "disjoint",
|
132
|
+
"set1": [1, 2],
|
133
|
+
"set2": [2, 3],
|
134
|
+
"expected": false
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"description": "sets are disjoint if they share no elements",
|
138
|
+
"property": "disjoint",
|
139
|
+
"set1": [1, 2],
|
140
|
+
"set2": [3, 4],
|
141
|
+
"expected": true
|
142
|
+
}
|
124
143
|
]
|
125
|
-
|
126
|
-
|
144
|
+
},
|
145
|
+
{
|
127
146
|
"description": "Sets with the same elements are equal",
|
128
147
|
"cases": [
|
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
|
-
|
148
|
+
{
|
149
|
+
"description": "empty sets are equal",
|
150
|
+
"property": "equal",
|
151
|
+
"set1": [],
|
152
|
+
"set2": [],
|
153
|
+
"expected": true
|
154
|
+
},
|
155
|
+
{
|
156
|
+
"description": "empty set is not equal to non-empty set",
|
157
|
+
"property": "equal",
|
158
|
+
"set1": [],
|
159
|
+
"set2": [1, 2, 3],
|
160
|
+
"expected": false
|
161
|
+
},
|
162
|
+
{
|
163
|
+
"description": "non-empty set is not equal to empty set",
|
164
|
+
"property": "equal",
|
165
|
+
"set1": [1, 2, 3],
|
166
|
+
"set2": [],
|
167
|
+
"expected": false
|
168
|
+
},
|
169
|
+
{
|
170
|
+
"description": "sets with the same elements are equal",
|
171
|
+
"property": "equal",
|
172
|
+
"set1": [1, 2],
|
173
|
+
"set2": [2, 1],
|
174
|
+
"expected": true
|
175
|
+
},
|
176
|
+
{
|
177
|
+
"description": "sets with different elements are not equal",
|
178
|
+
"property": "equal",
|
179
|
+
"set1": [1, 2, 3],
|
180
|
+
"set2": [1, 2, 4],
|
181
|
+
"expected": false
|
182
|
+
}
|
159
183
|
]
|
160
|
-
|
161
|
-
|
184
|
+
},
|
185
|
+
{
|
162
186
|
"description": "Unique elements can be added to a set",
|
163
187
|
"cases": [
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
188
|
+
{
|
189
|
+
"description": "add to empty set",
|
190
|
+
"property": "add",
|
191
|
+
"set": [],
|
192
|
+
"element": 3,
|
193
|
+
"expected": [3]
|
194
|
+
},
|
195
|
+
{
|
196
|
+
"description": "add to non-empty set",
|
197
|
+
"property": "add",
|
198
|
+
"set": [1, 2, 4],
|
199
|
+
"element": 3,
|
200
|
+
"expected": [1, 2, 3, 4]
|
201
|
+
},
|
202
|
+
{
|
203
|
+
"description": "adding an existing element does not change the set",
|
204
|
+
"property": "add",
|
205
|
+
"set": [1, 2, 3],
|
206
|
+
"element": 3,
|
207
|
+
"expected": [1, 2, 3]
|
208
|
+
}
|
182
209
|
]
|
183
|
-
|
184
|
-
|
185
|
-
"description": "
|
210
|
+
},
|
211
|
+
{
|
212
|
+
"description": "Intersection returns a set of all shared elements",
|
186
213
|
"cases": [
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
214
|
+
{
|
215
|
+
"description": "intersection of two empty sets is an empty set",
|
216
|
+
"property": "intersection",
|
217
|
+
"set1": [],
|
218
|
+
"set2": [],
|
219
|
+
"expected": []
|
220
|
+
},
|
221
|
+
{
|
222
|
+
"description": "intersection of an empty set and non-empty set is an empty set",
|
223
|
+
"property": "intersection",
|
224
|
+
"set1": [],
|
225
|
+
"set2": [3, 2, 5],
|
226
|
+
"expected": []
|
227
|
+
},
|
228
|
+
{
|
229
|
+
"description": "intersection of a non-empty set and an empty set is an empty set",
|
230
|
+
"property": "intersection",
|
231
|
+
"set1": [1, 2, 3, 4],
|
232
|
+
"set2": [],
|
233
|
+
"expected": []
|
234
|
+
},
|
235
|
+
{
|
236
|
+
"description": "intersection of two sets with no shared elements is an empty set",
|
237
|
+
"property": "intersection",
|
238
|
+
"set1": [1, 2, 3],
|
239
|
+
"set2": [4, 5, 6],
|
240
|
+
"expected": []
|
241
|
+
},
|
242
|
+
{
|
243
|
+
"description": "intersection of two sets with shared elements is a set of the shared elements",
|
244
|
+
"property": "intersection",
|
245
|
+
"set1": [1, 2, 3, 4],
|
246
|
+
"set2": [3, 2, 5],
|
247
|
+
"expected": [2, 3]
|
248
|
+
}
|
217
249
|
]
|
218
|
-
|
219
|
-
|
250
|
+
},
|
251
|
+
{
|
220
252
|
"description": "Difference (or Complement) of a set is a set of all elements that are only in the first set",
|
221
253
|
"cases": [
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
254
|
+
{
|
255
|
+
"description": "difference of two empty sets is an empty set",
|
256
|
+
"property": "difference",
|
257
|
+
"set1": [],
|
258
|
+
"set2": [],
|
259
|
+
"expected": []
|
260
|
+
},
|
261
|
+
{
|
262
|
+
"description": "difference of empty set and non-empty set is an empty set",
|
263
|
+
"property": "difference",
|
264
|
+
"set1": [],
|
265
|
+
"set2": [3, 2, 5],
|
266
|
+
"expected": []
|
267
|
+
},
|
268
|
+
{
|
269
|
+
"description": "difference of a non-empty set and an empty set is the non-empty set",
|
270
|
+
"property": "difference",
|
271
|
+
"set1": [1, 2, 3, 4],
|
272
|
+
"set2": [],
|
273
|
+
"expected": [1, 2, 3, 4]
|
274
|
+
},
|
275
|
+
{
|
276
|
+
"description": "difference of two non-empty sets is a set of elements that are only in the first set",
|
277
|
+
"property": "difference",
|
278
|
+
"set1": [3, 2, 1],
|
279
|
+
"set2": [2, 4],
|
280
|
+
"expected": [1, 3]
|
281
|
+
}
|
246
282
|
]
|
247
|
-
|
248
|
-
|
283
|
+
},
|
284
|
+
{
|
249
285
|
"description": "Union returns a set of all elements in either set",
|
250
286
|
"cases": [
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
287
|
+
{
|
288
|
+
"description": "union of empty sets is an empty set",
|
289
|
+
"property": "union",
|
290
|
+
"set1": [],
|
291
|
+
"set2": [],
|
292
|
+
"expected": []
|
293
|
+
},
|
294
|
+
{
|
295
|
+
"description": "union of an empty set and non-empty set is the non-empty set",
|
296
|
+
"property": "union",
|
297
|
+
"set1": [],
|
298
|
+
"set2": [2],
|
299
|
+
"expected": [2]
|
300
|
+
},
|
301
|
+
{
|
302
|
+
"description": "union of a non-empty set and empty set is the non-empty set",
|
303
|
+
"property": "union",
|
304
|
+
"set1": [1, 3],
|
305
|
+
"set2": [],
|
306
|
+
"expected": [1, 3]
|
307
|
+
},
|
308
|
+
{
|
309
|
+
"description": "union of non-empty sets contains all unique elements",
|
310
|
+
"property": "union",
|
311
|
+
"set1": [1, 3],
|
312
|
+
"set2": [2, 3],
|
313
|
+
"expected": [3, 2, 1]
|
314
|
+
}
|
275
315
|
]
|
276
|
-
|
316
|
+
}
|
317
|
+
]
|
277
318
|
}
|