mediumJavaScript

Flatten Array with Depth

Flatten a nested array up to a given depth.
Ensure function signatures match starter code to run test cases.
index.js
Loading...

Test Case #1

Input: [1,[2,[3,[4]]]],2

Expected: [1,2,3,[4]]

Solve Flatten Array with Depth | Algorithmic Interview Drill