일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Decorator
- Python Implementation
- Generator
- Convert Sorted List to Binary Search Tree
- Protocol
- 109. Convert Sorted List to Binary Search Tree
- 715. Range Module
- 파이썬
- Substring with Concatenation of All Words
- 315. Count of Smaller Numbers After Self
- 30. Substring with Concatenation of All Words
- concurrency
- Class
- shiba
- iterator
- attribute
- 밴픽
- 43. Multiply Strings
- Regular Expression
- Python
- 시바견
- kaggle
- 프로그래머스
- t1
- 운영체제
- DWG
- data science
- Python Code
- 컴퓨터의 구조
- LeetCode
Archives
- Today
- Total
목록54. Spiral Matrix (1)
Scribbling
LeetCode: 54. Spiral Matrix
Recursion solution: class Solution: def spiralOrder(self, matrix: List[List[int]]) -> List[int]: self.ret = [] self.helper(matrix, 0, 0, len(matrix), len(matrix[0])) return self.ret def helper(self, matrix, y, x, m, n): if m > 0: for i in range(n): self.ret.append(matrix[y][x]) x += 1 x -= 1 m -= 1 if n > 0 : for i in range(m): y += 1 self.ret.append(matrix[y][x]) n -= 1 if m > 0: for i in range..
Computer Science/Coding Test
2021. 9. 17. 19:16