Skip to content

Commit 4f5f15e

Browse files
useless else
Co-authored-by: Chaedong Im <[email protected]>
1 parent 00fb70b commit 4f5f15e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

contains-duplicate/changchanghwang.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ func containsDuplicate(nums []int) bool {
88
for _, num := range nums {
99
if hashMap[num] {
1010
return true
11-
} else {
12-
hashMap[num] = true
13-
}
11+
}
12+
hashMap[num] = true
1413
}
1514
return false
1615
}

0 commit comments

Comments
 (0)