본문 바로가기
알고리즘/소스코드

LEETCODE 287: Find the Duplicate Number

by cjw.git 2021. 8. 5.

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

  1.  

 

 

 

cjw.git@gmail.com

댓글