gary@interview:~/interview/coding/71-simplify-path.md$
$ cat ./coding/71-simplify-path.md
[Coding]

71. Simplify Path

────────────────────────────────────────────────────────────

71. Simplify Path

class Solution:
    def simplifyPath(self, path: str) -> str:
        
        tmp = path.split('/')
        res = []
        for item in tmp:
            if item == '' or item == '.':
                continue
            elif item == '..':
                if len(res) > 0:
                    res.pop()
            else:
                res.append(item)
        
        return "/" + "/".join(res)
--tags#Stack
$ ls ./coding/ | grep -v 71-simplify-path
265. Paint House II256. Paint House143. Reorder List1762. Buildings With an Ocean View
← cd ../codingcd ~