Wang Jian
Results
2
comments of
Wang Jian
题目要求 Do not allocate extra space for another array. You must do this by modifying the input array in-place with O(1) extra memory. > @halfrost > @zhangguolei 用 map 也可以。
``` func removeDuplicates(nums []int) int { i, j := 0, 0 for j < len(nums)-1 { if nums[j] == nums[j+1] { j++ continue } i++ j++ nums[i] = nums[j] }...