class Solution: # @param A a list of integers # @param elem an integer, value need to be removed # @return an integer def removeElement(self, A, elem): n=len(A) for i in reversed(range(n)): if A[i]==elem: A.pop(i) n-=1 return n
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment