标签:
public class Solution { public int removeElement(int[] A, int elem) { if(A==null||A.length<1) return 0; // same http://www.cnblogs.com/springfor/p/3871046.html int len = 0; for(int i=0; i< A.length; i++){ if(A[i]!=elem){ if(A[len]!=A[i]){ A[len] = A[i]; } len++; } } return len; } }
标签:
原文地址:http://www.cnblogs.com/jiajiaxingxing/p/4414319.html