diff --git a/contains-duplicate/SamTheKorean.go b/contains-duplicate/SamTheKorean.go new file mode 100644 index 000000000..e7a58b94d --- /dev/null +++ b/contains-duplicate/SamTheKorean.go @@ -0,0 +1,17 @@ +// TC : O(n) : it iterates for the length of nums +// SC : O(n) : hashmap is created with the size of nums + +func containsDuplicate(nums []int) bool { + hashmap := make(map[int]bool) + + for i:=0;i