일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 30. Substring with Concatenation of All Words
- DWG
- attribute
- 109. Convert Sorted List to Binary Search Tree
- Generator
- Convert Sorted List to Binary Search Tree
- 밴픽
- 315. Count of Smaller Numbers After Self
- 파이썬
- Python
- 컴퓨터의 구조
- kaggle
- Regular Expression
- Python Implementation
- shiba
- concurrency
- 시바견
- iterator
- Class
- t1
- 프로그래머스
- Protocol
- data science
- 운영체제
- Substring with Concatenation of All Words
- 715. Range Module
- 43. Multiply Strings
- Python Code
- LeetCode
- Decorator
Archives
- Today
- Total
목록Find All Duplicates in an Array (1)
Scribbling
LeetCode: 442. Find All Duplicates in an Array
O(N), O(1) Solution by using input array as a memory. class Solution: def findDuplicates(self, nums: List[int]) -> List[int]: ret = [] for i, num in enumerate(nums): if nums[abs(num) - 1] < 0: ret.append(abs(num)) nums[abs(num) - 1] *= -1 return ret
Computer Science/Coding Test
2022. 1. 5. 11:08