/***
 * 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 class Solution {
    public int removeElement(int[] A, int elem) {
        if (A.length == 0)
            return 0;
        int j = 0;
        for (int i = 0; i < A.length; i++) {
            if (A[i] == elem)
                j++;
            else
                A[i - j] = A[i];
        }
        return A.length - j;
    }
}

@@ -228,16 +228,23 @@
 ution %7B%0A
+    /*%0A
     publ
@@ -544,10 +544,238 @@
 ;%0A    %7D%0A
+    */%0A    public int removeElement(int%5B%5D A, int elem) %7B%0A        int index = 0;%0A        for (int i = 0; i %3C A.length; i++) %7B%0A            if (A%5Bi%5D != elem)%0A                A%5Bindex++%5D = A%5Bi%5D;%0A        %7D%0A        return index;%0A    %7D%0A
 %7D%0A

add RemoveElement.java