mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-07 01:44:56 +08:00
Update 0027 solution
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user