일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 운영체제
- concurrency
- 109. Convert Sorted List to Binary Search Tree
- 시바견
- DWG
- data science
- iterator
- 파이썬
- kaggle
- 715. Range Module
- 밴픽
- 315. Count of Smaller Numbers After Self
- Python
- 30. Substring with Concatenation of All Words
- Python Code
- shiba
- Generator
- Decorator
- 컴퓨터의 구조
- Protocol
- Regular Expression
- attribute
- t1
- Convert Sorted List to Binary Search Tree
- 프로그래머스
- Python Implementation
- Substring with Concatenation of All Words
- 43. Multiply Strings
- LeetCode
- Class
Archives
- Today
- Total
목록45. Jump Game II (1)
Scribbling
LeetCode: 45. Jump Game II
욕심쟁이는 풀 수 있는 문제 class Solution: def jump(self, nums: List[int]) -> int: if len(nums) == 1: return 0 now, jump = 0, 0 while True: if now + nums[now] >= len(nums) - 1: return jump + 1 val, next_idx = -1, -1 for i in range(now+1, min(now+nums[now]+1, len(nums))): if i + nums[i] > val: val = i + nums[i] next_idx = i now = next_idx jump += 1
Computer Science/Coding Test
2021. 9. 13. 22:17