Skip to content

Commit 2b171cc

Browse files
committed
contains-duplicate: adjust init size
1 parent a8669da commit 2b171cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contains-duplicate/invidam.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
func containsDuplicate(nums []int) bool {
2-
appeared := make(map[int]bool, len(nums))
2+
appeared := make(map[int]bool, len(nums)/4)
33

44
for _, num := range nums {
55
if _, found := appeared[num]; found {

0 commit comments

Comments
 (0)