
287. Find the Duplicate Number
·
Algorithm
Find the Duplicate Number - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1. 선형 탐색 (시간 초과) class Solution: def findDuplicate(self, nums): nums.sort() for i in range(1, len(nums)): if nums[i] == nums[i-1]: return nums[i] 2. HashMap or Set (공간 초과) class Solution: def findDuplicate(..