I am a bit confused about the question, the example is
let nestedArray = [ //level 0
['deep'], //level 1
[ //level 2
['deeper'], ['deeper']
//[2][0], [2][1]
],
[ //level 3
[
['deepest'], ['deepest']
],
[ //level 4
[
['deepest-est?']
]
]
]
];
and description says
The
deep
array is nested 2 levels deep. Thedeeper
arrays are 3 levels deep. Thedeepest
arrays are 4 levels, and thedeepest-est?
is 5.
I am a bit confused because from my understanding it is on level 1 and so on. I have commented out how I understand array.
Edit : Here is link to the algo