Skip to content

Commit

Permalink
Merge pull request #221 from Varalakshmi2354/potd-solution
Browse files Browse the repository at this point in the history
Solution to remove duplicates from array
  • Loading branch information
Gyanthakur authored Oct 29, 2024
2 parents 64e3a28 + 595de87 commit 6996d91
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions october_2024/GFG_POTD_28_OCT_2024.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class Solution:
def removeDuplicates(self, arr):
seen = set()
result = []
for num in arr:
if num not in seen:
seen.add(num)
result.append(num)
return result

0 comments on commit 6996d91

Please sign in to comment.