Simplify Path

Medium

📝 Description

Simplify a Unix-style file path

Input Format

A string representing absolute path

Output Format

Simplified canonical path

Constraints

1 ≤ path.length ≤ 3000

🔍 Sample Input

"/a/./b/../../c/"
            

✅ Sample Output

"/c"
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run