Update 0242.有效的字母异位词.md

添加27. 移除元素 go版本
This commit is contained in:
X-shuffle
2021-05-12 15:41:32 +08:00
committed by GitHub
parent cdc9b27c68
commit 04bb63da12

View File

@ -91,8 +91,19 @@ Python
Go
```go
func removeElement(nums []int, val int) int {
length:=len(nums)
res:=0
for i:=0;i<length;i++{
if nums[i]!=val {
nums[res]=nums[i]
res++
}
}
return res
}
```
-----------------------