NeetCode #358LC-71MediumStackNC 250
← Back to All Problems

#358 · #71 · Simplify Path(简化路径)

📌 Problem Statement & Constraints

Given an absolute Unix-style path, simplify it to its canonical form: it must start with a single /, contain no . or .. components, no double slashes, and no trailing slash (except for the root). Constraints: 1 <= path.length <= 3000.
🔒

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!