Merge pull request #1522 from trist725/master

需要同时修改输入数组nums
This commit is contained in:
程序员Carl 2022-07-15 08:49:29 +08:00 committed by GitHub
commit 69084bbecf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

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