071 Simplify Path
有了split,天下我有
class Solution: # @param {string} path # @return {string} def simplifyPath(self, path): stack = [] for s in path.split("/"): if s == "": continue elif s == "..": if stack != []: stack.pop() elif s == ".": pass else: stack.append(s) return "/" + "/".join(stack)