일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- attribute
- 파이썬
- 43. Multiply Strings
- iterator
- Generator
- 운영체제
- Protocol
- Python Implementation
- Decorator
- shiba
- Python
- 715. Range Module
- Class
- 프로그래머스
- t1
- Substring with Concatenation of All Words
- 시바견
- Regular Expression
- data science
- DWG
- 109. Convert Sorted List to Binary Search Tree
- 컴퓨터의 구조
- Python Code
- 밴픽
- LeetCode
- 315. Count of Smaller Numbers After Self
- concurrency
- kaggle
- Convert Sorted List to Binary Search Tree
- 30. Substring with Concatenation of All Words
Archives
- Today
- Total
목록18. 4Sum (1)
Scribbling
LeetCode: 18. 4Sum
class Solution: def fourSum(self, nums: List[int], target: int) -> List[List[int]]: ret = [] nums.sort() previ = None for i in range(len(nums)-3): if nums[i] == previ: continue prevj = None for j in range(i+1, len(nums)-2): if nums[j] == prevj: continue preSum = nums[i] + nums[j] l, r = j + 1, len(nums) - 1 while l < r: summation = preSum + nums[l] + nums[r] if summation < target: l += 1 elif su..
Computer Science/Coding Test
2021. 8. 22. 22:05