parent
04bb63da12
commit
08781d4ceb
|
|
@ -129,7 +129,19 @@ Python:
|
||||||
|
|
||||||
|
|
||||||
Go:
|
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
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
JavaScript:
|
JavaScript:
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue