일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 컴퓨터의 구조
- 715. Range Module
- LeetCode
- Decorator
- DWG
- 315. Count of Smaller Numbers After Self
- Python
- Python Implementation
- data science
- Regular Expression
- 파이썬
- Substring with Concatenation of All Words
- Convert Sorted List to Binary Search Tree
- attribute
- Generator
- Class
- 109. Convert Sorted List to Binary Search Tree
- iterator
- 운영체제
- concurrency
- 시바견
- 프로그래머스
- kaggle
- t1
- shiba
- 밴픽
- 30. Substring with Concatenation of All Words
- Python Code
- 43. Multiply Strings
- Protocol
Archives
- Today
- Total
목록Game Of Life (1)
Scribbling
LeetCode: 289. Game of Life
To solve this problem in-place, we can think of using two more states(2, 3) rather than two states(1, 0). class Solution: def gameOfLife(self, board: List[List[int]]) -> None: """ Do not return anything, modify board in-place instead. """ m, n = len(board), len(board[0]) for y in range(m): for x in range(n): cnt = self.countOnes(board, y, x) if board[y][x] == 0: if cnt == 3: board[y][x] = 3 else..
Computer Science/Coding Test
2021. 12. 29. 20:18