class Solution(object):
	def removeElement(self, nums, val):
		"""
		:type nums: List[int]
		:type val: int
		:rtype: int
		"""
		if not nums:
			return 0

		newTail = 0
		for num in nums:
			if num != val:
				nums[newTail] = num
				newTail += 1

		return newTail
