fork download
  1. class Solution(object):
  2. def removeElement(self, nums, val):
  3. """
  4. :type nums: List[int]
  5. :type val: int
  6. :rtype: int
  7. """
  8. k = 0
  9. for x in nums:
  10. if x != val:
  11. nums[k] = x
  12. k += 1
  13. return k
  14. # your code goes here
Success #stdin #stdout 0.13s 14136KB
stdin
Standard input is empty
stdout
Standard output is empty