Guest User

Untitled

a guest
Sep 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. func removeElement(nums []int, val int) int {
  2. n := 0
  3. for i, num := range nums {
  4. if num != val {
  5. nums[n] = nums[i]
  6. n++
  7. }
  8. }
  9. return n
  10. }
Add Comment
Please, Sign In to add comment