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