Practice Problem

Simplify Path

Difficulty: Medium

Given an absolute Unix-style file path, simplify it by resolving '.', '..', and multiple slashes to produce the canonical path.