@@ -0,0 +1,646 @@
+/**%0A * Problem: #27 Remove Element%0A *%0A * Idea: One point to count numbers of elements to delete, the other is for the current%0A * position to store the values that are not going to be deleted.%0A *%0A * Solutions:%0A *  removeElement: two pointers%0A */%0Apublic class RemoveElement %7B%0A    public int removeElement(int%5B%5D nums, int val) %7B%0A        int counter = 0;%0A        int current = 0;%0A        for (int i = 0; i %3C nums.length; i++) %7B%0A            if (nums%5Bi%5D == val) %7B%0A                counter ++;%0A            %7D else %7B%0A                nums%5Bcurrent%5D = nums%5Bi%5D;%0A                current ++;%0A            %7D%0A        %7D%0A        return nums.length - counter;%0A    %7D%0A%7D%0A

Add new solution