class Solution:
def simplifyPath(self, path: str) -> str:
l = path.split('/')
res = []
for i in range(len(l)):
if l[i] == '..':
if res:
res.pop()
elif l[i] != '' and l[i] != '.':
res.append(l[i])
return '/' + '/'.join(res)



