Skip to content

Commit

Permalink
Time: 10 ms (88.77%), Space: 57.3 MB (69.83%) - LeetHub
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit-S-Sahu committed Oct 23, 2024
1 parent 184a084 commit db0f465
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions 0217-contains-duplicate/0217-contains-duplicate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class Solution {
public boolean containsDuplicate(int[] nums) {
HashSet<Integer> set = new HashSet<>();
for (int num : nums) {
if (set.contains(num)) return true;
set.add(num);
}
return false;
}
}

0 comments on commit db0f465

Please sign in to comment.