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