class Solution:
def simplifyPath(self, path: str) -> str:
List = path.split('/')
stack = []
for ele in List:
if ele:
if ele == '.':
continue
elif ele == '..':
if len(stack):
stack.pop()
else:
stack.append(ele)
res = '/'.join(stack)
return '/' + res