Given a string 'path' representing the absolute path of a file in a Unix-like file system, simplify it.
Note:
Absolute Path: "/home/"
Simplified Path: "/home"
Absolute Path: "/../"
Simplified Path: "/"
Absolute Path: "/a/./b/../../c/../d/"
Simplified Path: "/d"
The first line contains an integer âTâ, denoting the number of test cases.
For each test case the input contains a single line with a string denoting the absolute path.
For each test case, a line containing a string denoting the simplified path.
3
/home/
/../
/a/./b/../../c/../d/
/home
/
/d
1 <= T <= 100
1 <= n <= 3000
Valid characters in path: a-z, 0-9, '.', '/'