这应该是比较简单的一道题目
Given an array and a value, remove all instances of that value in place and return the new length.
The order of elements can be changed. It doesn’t matter what you leave beyond the new length.
public static int solution2_1_11(int[] num,int n,int ele){
int k=0;
for(int i=0;i<n;i++){
num[i-k]=num[i];
if(num[i]==ele)
k++;
}
for(int i=0;i<n-k;i++){
System.out.print(num[i]+" ");
}
return n-k;
}