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.
0
Mid April, 2025
Apple
Staff
Late March, 2025
Meta
Mid-level
Early February, 2025
Meta
Mid-level
Hello Interview Premium
Your account is free and you can post anonymously if you choose.