Search
⌘K

Leetcode 2625. Flatten Deeply Nested Array

Flatten a nested array up to a given depth n: return a new array where only subarrays whose nesting depth is less than n (top-level elements have depth 0) are expanded into their elements. This requires a depth-limited traversal (e.g., recursive/stack-based) to concatenate elements while preserving deeper nested arrays.

Asked at:

Meta

Apple


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid April, 2025

Apple

Staff

Late March, 2025

Meta

Mid-level

Mid March, 2025

Meta

Mid-level

Comments

Your account is free and you can post anonymously if you choose.