Skip to content

Commit 4e942db

Browse files
committed
add shortened solution of contains-duplicate
1 parent e59a813 commit 4e942db

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

contains-duplicate/Ujoonnee.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,12 @@ public boolean containsDuplicate(int[] nums) {
1313
}
1414
return false;
1515
}
16-
}
16+
}
17+
18+
/*
19+
class Solution {
20+
public boolean containsDuplicate(int[] nums) {
21+
return Arrays.stream(nums).distinct().count() != nums.length;
22+
}
23+
}
24+
*/

0 commit comments

Comments
 (0)