일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- sql코테
- two-pointer
- GenAI
- heap
- 자연어처리
- nlp
- 투포인터
- 릿코드
- medium
- LeetCode
- 코드업
- 슬라이딩윈도우
- 알고리즘
- GenerativeAI
- 파이썬
- SQL
- stratascratch
- gcp
- codeup
- Python
- 니트코드
- 생성형AI
- Microsoft
- slidingwindow
- Python3
- 파이썬알고리즘
- 구글퀵랩
- dfs
- 파이썬기초100제
- 리트코드
Archives
- Today
- Total
목록set (1)
Tech for good

풀이1) set 자료구조 사용class Solution: def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]: return list(set(nums1) & set(nums2))시간 복잡도 분석set(nums1): O(N)set(nums2): O(M)set1 & set2: O(min(N, M))list(...): O(K) (교집합 원소 수를 K라고 가정)➡️ 최종 시간 복잡도: O(N + M) (매우 효율적)풀이2) two-pointer 사용class Solution: def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]: ..
IT/Computer Science
2025. 2. 21. 02:39