Intersection of Two Arrays II Solutions in GoNumber 350Difficulty EasyAcceptance 51.4%Link LeetCodeOther languages C++, JavaSolutionsGo solution by halfrost/LeetCode-Gopackage leetcode func intersect(nums1 []int, nums2 []int) []int { m := map[int]int{} var res []int for _, n := range nums1 { m[n]++ } for _, n := range nums2 { if m[n] > 0 { res = append(res, n) m[n]-- } } return res}package leetcode func intersect(nums1 []int, nums2 []int) []int { m := map[int]int{} var res []int for _, n := range nums1 { m[n]++ } for _, n := range nums2 { if m[n] > 0 { res = append(res, n) m[n]-- } } return res }