일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- data science
- Class
- Decorator
- Generator
- iterator
- Convert Sorted List to Binary Search Tree
- DWG
- 컴퓨터의 구조
- t1
- concurrency
- 43. Multiply Strings
- Python
- Python Code
- Substring with Concatenation of All Words
- 운영체제
- 30. Substring with Concatenation of All Words
- 프로그래머스
- attribute
- 시바견
- 715. Range Module
- Python Implementation
- Regular Expression
- 109. Convert Sorted List to Binary Search Tree
- Protocol
- 밴픽
- 315. Count of Smaller Numbers After Self
- LeetCode
- shiba
- kaggle
- 파이썬
Archives
- Today
- Total
목록454. 4Sum II (1)
Scribbling
LeetCode: 454. 4Sum II
First thing to try is iterating nums1, nums2, nums3 and looking for the corresponding element in nums4. This will result in O(N**3) time complexity, which raises TLE. class Solution: def fourSumCount(self, nums1: List[int], nums2: List[int], nums3: List[int], nums4: List[int]) -> int: from collections import Counter c = Counter(nums4) ret = 0 for n1 in nums1: for n2 in nums2: for n3 in nums3: re..
Computer Science/Coding Test
2022. 1. 16. 14:15