|
1 | 1 | { |
2 | | - "exercise": "flatten-array", |
3 | | - "version": "1.0.0", |
4 | | - "cases": [ |
5 | | - { |
6 | | - "description": "flattens array with just integers present", |
7 | | - "property": "flatten", |
8 | | - "input": [1,[2,3,4,5,6,7],8], |
9 | | - "expected": [1,2,3,4,5,6,7,8] |
10 | | - }, |
11 | | - { |
12 | | - "description": "5 level nesting", |
13 | | - "property": "flatten", |
14 | | - "input": [0, 2, [[2, 3], 8, 100, 4,[[[50]]]], -2], |
15 | | - "expected":[0, 2, 2, 3, 8, 100, 4, 50, -2] |
16 | | - }, |
17 | | - { |
18 | | - "description": "6 level nesting", |
19 | | - "property": "flatten", |
20 | | - "input": [1,[2,[[3]],[4,[[5]]],6,7],8], |
21 | | - "expected":[1,2,3,4,5,6,7,8] |
22 | | - }, |
23 | | - { |
24 | | - "description": "6 level nest list with null values", |
25 | | - "property": "flatten", |
26 | | - "input": [0, 2, [[2, 3], 8, [[100]], null, [[null]]], -2], |
27 | | - "expected":[0,2,2,3,8,100,-2] |
28 | | - }, |
29 | | - { |
30 | | - "description": "all values in nested list are null", |
31 | | - "property": "flatten", |
32 | | - "input": [null,[[[null]]],null,null,[[null,null],null],null], |
33 | | - "expected":[] |
34 | | - } |
35 | | - ] |
| 2 | + "exercise": "flatten-array", |
| 3 | + "version": "1.0.0", |
| 4 | + "cases": [ |
| 5 | + { |
| 6 | + "description": "flattens array with just integers present", |
| 7 | + "property": "flatten", |
| 8 | + "input": [1, [2, 3, 4, 5, 6, 7], 8], |
| 9 | + "expected": [1, 2, 3, 4, 5, 6, 7, 8] |
| 10 | + }, |
| 11 | + { |
| 12 | + "description": "5 level nesting", |
| 13 | + "property": "flatten", |
| 14 | + "input": [0, 2, [[2, 3], 8, 100, 4, [[[50]]]], -2], |
| 15 | + "expected": [0, 2, 2, 3, 8, 100, 4, 50, -2] |
| 16 | + }, |
| 17 | + { |
| 18 | + "description": "6 level nesting", |
| 19 | + "property": "flatten", |
| 20 | + "input": [1, [2, [[3]], [4, [[5]]], 6, 7], 8], |
| 21 | + "expected": [1, 2, 3, 4, 5, 6, 7, 8] |
| 22 | + }, |
| 23 | + { |
| 24 | + "description": "6 level nest list with null values", |
| 25 | + "property": "flatten", |
| 26 | + "input": [0, 2, [[2, 3], 8, [[100]], null, [[null]]], -2], |
| 27 | + "expected": [0, 2, 2, 3, 8, 100, -2] |
| 28 | + }, |
| 29 | + { |
| 30 | + "description": "all values in nested list are null", |
| 31 | + "property": "flatten", |
| 32 | + "input": [null, [[[null]]], null, null, [[null, null], null], null], |
| 33 | + "expected": [] |
| 34 | + } |
| 35 | + ] |
36 | 36 | } |
0 commit comments