일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Tags
- 315. Count of Smaller Numbers After Self
- Regular Expression
- LeetCode
- concurrency
- 시바견
- 컴퓨터의 구조
- Substring with Concatenation of All Words
- t1
- Class
- 밴픽
- 프로그래머스
- Python Code
- kaggle
- 109. Convert Sorted List to Binary Search Tree
- Python
- 30. Substring with Concatenation of All Words
- 715. Range Module
- data science
- Decorator
- 43. Multiply Strings
- attribute
- iterator
- Generator
- DWG
- shiba
- Protocol
- 파이썬
- 운영체제
- Python Implementation
- Convert Sorted List to Binary Search Tree
Archives
- Today
- Total
목록Simplify Path (1)
Scribbling
LeetCode: 71. Simplify Path
class Solution: def simplifyPath(self, path: str) -> str: stack = [] paths = path.split('/') for path in paths: if path: if path == '.': continue elif path == '..': if stack: stack.pop() else: stack.append(path) ret = '/' for path in stack: ret += path + '/' if not stack: return ret return ret[:-1]
Computer Science/Coding Test
2021. 9. 26. 17:22