Given an absolute Unix-style file path, simplify it to its canonical form: '.' means the current directory, '..' moves up one level, and multiple slashes collapse to one. The canonical path starts with a single '/' and has no trailing slash (except the root). Return the simplified path. The input is JSON {path}.
Input: JSON {path}.
Output: String — the canonical path.
Input: {"path":"/a/./b/../../c/"}
Output: /c
Explanation: Resolves to /c.Input: {"path":"/../"}
Output: /
Explanation: Cannot go above root.Input: {"path":"/home//foo/"}
Output: /home/foo
Explanation: Collapses double slashes.1<=|path|<=3000