需要同时修改输入数组nums

This commit is contained in:
Tristone
2022-07-14 22:39:17 +08:00
parent f2b5da5986
commit 781076a73d

View File

@ -219,6 +219,7 @@ func removeElement(nums []int, val int) int {
res++
}
}
nums=nums[:res]
return res
}
```