일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Python Implementation
- 프로그래머스
- 30. Substring with Concatenation of All Words
- Python Code
- Class
- 715. Range Module
- 315. Count of Smaller Numbers After Self
- Substring with Concatenation of All Words
- kaggle
- 109. Convert Sorted List to Binary Search Tree
- concurrency
- 파이썬
- Generator
- 43. Multiply Strings
- DWG
- LeetCode
- data science
- 컴퓨터의 구조
- Regular Expression
- t1
- attribute
- iterator
- shiba
- 운영체제
- 밴픽
- Decorator
- Convert Sorted List to Binary Search Tree
- 시바견
- Protocol
- Python
Archives
- Today
- Total
목록442. 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