일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Python
- Protocol
- 파이썬
- Decorator
- 30. Substring with Concatenation of All Words
- 315. Count of Smaller Numbers After Self
- 시바견
- Python Implementation
- Python Code
- t1
- Class
- 운영체제
- DWG
- Generator
- 43. Multiply Strings
- iterator
- shiba
- LeetCode
- Substring with Concatenation of All Words
- 715. Range Module
- 밴픽
- attribute
- data science
- 컴퓨터의 구조
- 프로그래머스
- kaggle
- Convert Sorted List to Binary Search Tree
- 109. Convert Sorted List to Binary Search Tree
- Regular Expression
Archives
- Today
- Total
목록gas station (1)
Scribbling
LeetCode: 134. Gas Station
class Solution: def canCompleteCircuit(self, gas: List[int], cost: List[int]) -> int: culsum = 0 for i in range(len(gas)): gas[i] -= cost[i] culsum += gas[i] if culsum < 0: return -1 start_idx, culsum = 0, 0 for i in range(len(gas)): culsum += gas[i] if culsum < 0: culsum = 0 start_idx = i + 1 return start_idx
Computer Science/Coding Test
2021. 11. 26. 12:02