Golang | Leetcode Golang题解之第349题两个数组的交集
题目: 题解: func intersection(nums1 []int, nums2 []int) (res []int) {sort.Ints(nums1)sort.Ints(nums2)for i, j : 0, 0; i < len(nums1) && j < len(nums2); {x, y : nums1[i], nums2[j]if x y {if res nil || x > res[len(re…
2025-09-18