Skip to content

Commit 6ffd9a9

Browse files
authored
Create Contains_Duplicate
Signed-off-by: Devanshi Lawania <[email protected]>
1 parent 6ae4493 commit 6ffd9a9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Contains_Duplicate

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution {
2+
public boolean containsDuplicate(int[] nums) {
3+
Arrays.sort(nums);
4+
for(int i=0;i<nums.length-1;i++){
5+
if(nums[i]==nums[i+1]){
6+
return true;
7+
}
8+
}
9+
return false;
10+
}
11+
}

0 commit comments

Comments
 (0)