give string path absolute path start slash file directory Unixstyle file system convert simplified canonical pathIn Unixstyle file system period refer current directory double period refer directory level multiple consecutive slash ie treat single slash for problem format period treat filedirectory namesthe canonical path follow formatthe path start single slash any directory separate single slash the path end trail the path contain directory path root directory target file directory ie period double period Return simplify canonical path Example 1input path homeOutput homeExplanation note trail slash directory nameExample 2input path Output Explanation go level root directory noop root level high level goexample 3input path homefoooutput homefooexplanation in canonical path multiple consecutive slash replace single Constraints1 pathlength 3000path consist english letter digit period slash _ path valid absolute Unix path