Canonical file path
Your task
Given an absolute Unix-style file path, return its canonical form. In the path, . means the current directory, .. means the parent directory (and is a no-op at the root), and multiple consecutive slashes are treated as a single slash. The canonical path must start with a single /, must not have a trailing slash (except for the root /), and must not contain any . or .. components or empty segments.
Examples
simplify_path(path: str) -> strExample 1
Input
simplify_path("/home//foo/")Output
"/home/foo"