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