Link : https://leetcode.com/problems/find-the-duplicate-number/solution/
Python
더보기
1
2
3
4
5
6
7
8
|
class Solution:
def findDuplicate(self, nums: list[int]) -> int:
arr = dict()
for i in nums:
if i not in arr:
arr[i] = True
else:
return i
|
cs |
FeedBack
cjw.git@gmail.com
'알고리즘 > 소스코드' 카테고리의 다른 글
PROGRAMMERS 77486: 다단계 칫솔 판매 (0) | 2021.12.31 |
---|---|
PROGRAMMERS 72411: 메뉴 리뉴얼 (0) | 2021.12.31 |
LEETCODE 128. Longest Consecutive Sequence (0) | 2021.08.05 |
LEETCODE 46: PERMUTATIONS (0) | 2021.08.05 |
PROGRAMMERS 49189: 가장 먼 노드 (0) | 2021.07.27 |
댓글