일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 시바견
- data science
- 파이썬
- Decorator
- Class
- 프로그래머스
- 43. Multiply Strings
- Python Implementation
- Substring with Concatenation of All Words
- DWG
- iterator
- Regular Expression
- 밴픽
- kaggle
- Python Code
- t1
- 운영체제
- 315. Count of Smaller Numbers After Self
- Convert Sorted List to Binary Search Tree
- Generator
- Protocol
- shiba
- 715. Range Module
- 컴퓨터의 구조
- concurrency
- attribute
- 30. Substring with Concatenation of All Words
- 109. Convert Sorted List to Binary Search Tree
- LeetCode
- Python
Archives
- Today
- Total
목록289. 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