Skip to content

Commit

Permalink
Merge pull request #92 from JohannesDev/287.-Find-the-Duplicate-Number
Browse files Browse the repository at this point in the history
Add Solution for 287. Find the Duplicate Number in python
  • Loading branch information
Rohit0301 authored Oct 4, 2022
2 parents b1036c0 + 0b47ea6 commit 0990f9e
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Solution:
def findDuplicate(self, nums: List[int]) -> int:
occurences = {}

for num in nums:
if num in occurences.keys():
return num
occurences[num] = 1

0 comments on commit 0990f9e

Please sign in to comment.