public class Solution {
public int removeElement(int[] A, int elem) {
int newLength = 0;
for (int pos=0; pos<A.length; pos++){
if (A[pos] != elem){
A[newLength] = A[pos];
newLength++;
}
}
return newLength;
}
}
Remove Element
最新推荐文章于 2021-02-10 01:24:19 发布