class Solution:
def removeElement(self, nums: List[int], val: int) -> int:
nums.sort()
k=0
for i in range(len(nums)):
if(nums[i]==val):
continue
else:
nums[k]=nums[i]
k=k+1
return k
day2
最新推荐文章于 2022-08-15 20:52:31 发布
class Solution:
def removeElement(self, nums: List[int], val: int) -> int:
nums.sort()
k=0
for i in range(len(nums)):
if(nums[i]==val):
continue
else:
nums[k]=nums[i]
k=k+1
return k