forked from exercism/problem-specifications
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flatten-array.json
29 lines (29 loc) · 863 Bytes
/
flatten-array.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
{
"cases": [
{
"description": "flattens array with just integers present",
"input": [1,[2,3,4,5,6,7],8],
"expected": [1,2,3,4,5,6,7,8]
},
{
"description": "5 level nesting",
"input": [0, 2, [[2, 3], 8, 100, 4,[[[50]]]], -2],
"expected":[0, 2, 2, 3, 8, 100, 4, 50, -2]
},
{
"description": "6 level nesting",
"input": [1,[2,[[3]],[4,[[5]]],6,7],8],
"expected":[1,2,3,4,5,6,7,8]
},
{
"description": "6 level nest list with null values",
"input": [0, 2, [[2, 3], 8, [[100]], null, [[null]]], -2],
"expected":[0,2,2,3,8,100,-2]
},
{
"description": "all values in nested list are null",
"input": [null,[[[null]]],null,null,[[null,null],null],null],
"expected":[]
}
]
}