You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given an absolute path to a file or directory in a Unix-style file system,
3
+
convert it to the simplified canonical path.
4
+
5
+
In a Unix-style file system, a period '.' refers to the current directory.
6
+
A double period '..' refers to the directory up a level.
7
+
Any multiple consecutive slashes (i.e. '//') are treated as a single slash '/'.
8
+
For this problem, any other format of periods such as '...' are treated as file/directory names.
9
+
10
+
The canonical path should have the following format:
11
+
- The path starts with a single slash '/'.
12
+
- Any two directories are separated by a single slash '/'.
13
+
- The path does not end with a trailing '/'.
14
+
- The path only contains the directories on the path from the root directory to the target file or directory (i.e., no period '.' or double period '..')
0 commit comments