Update 0027 solution

This commit is contained in:
YDZ
2020-11-25 00:52:55 +08:00
parent 4384f0d468
commit 5770d110d0
2 changed files with 2 additions and 6 deletions

View File

@ -9,10 +9,8 @@ func removeElement(nums []int, val int) int {
if nums[i] != val {
if i != j {
nums[i], nums[j] = nums[j], nums[i]
j++
} else {
j++
}
j++
}
}
return j