LearnPy Hub
← Arena
IntermediateRating 1300

Simplify a Path

Simplify a Unix-style absolute path: handle ., .. and repeated slashes.

Input

One path.

Output

The simplified path.

Sample 1

Input
/home/
Output
/home

Sample 2

Input
/../
Output
/
solution.py
Output appears here
Simplify a Path · Python Arena problem · LearnPy Hub