NeetCode #965LC-2625MediumJavaScript
← Back to All Problems

#965 · #2625 · Flatten Deeply Nested Array(扁平化嵌套数组)

📌 Problem Statement & Constraints

Given a multi-level nested array arr and a depth n, return a new array flattened to depth n. The depth counts nesting levels, so n = 0 returns a shallow copy of the input.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!