diff --git a/rm-duplicates.go b/rm-duplicates.go new file mode 100644 index 0000000..f9e7980 --- /dev/null +++ b/rm-duplicates.go @@ -0,0 +1,36 @@ +package main + +import ( + "fmt" +) + +func main() { + + nums := []int{0,0,1,1,1,2,3,4,4} + fmt.Println(removeDuplicates(nums)) + +} + +func removeDuplicates(nums []int) int { + m := make(map[int]int) + + for i:=0; i