Leetcode Golang 27. Remove Element.go

思路 暴力解決git code func removeElement(nums []int, val int) int { if nums == nil { return 0 } for i := 0; i < len(nums); { if nums[i] == val { nums = append(nums[:i], nums[i+1:]...) i-- }
相關文章
相關標籤/搜索