@@ -0,0 +1,745 @@
+package leetcode.remove_element;%0A%0Apublic class Solution %7B%0A    public int removeElement(int%5B%5D A, int elem) %7B%0A    %09if(A == null) return 0;%0A    %09int tail = A.length - 1;%0A    %09for(int i = 0; i %3C A.length; i++)%7B%0A    %09%09if(A%5Bi%5D == elem)%7B%0A    %09%09%09while(tail %3E= 0 && A%5Btail%5D == elem)%7B%0A    %09%09%09%09tail--;%0A    %09%09%09%7D%0A    %09%09%09if(tail %3E i)%7B%0A    %09%09%09%09A%5Bi%5D = A%5Btail%5D;%0A    %09%09%09%09tail--;%0A    %09%09%09%7D%0A    %09%09%09else break;%0A    %09%09%7D%0A    %09%7D%0A    %09return tail + 1;%0A    %7D%0A    %0A    public static void main(String%5B%5D args)%7B%0A    %09int%5B%5D ary = new int%5B%5D%7B3, 2, 2, 2, 5, 8, 3, 3%7D;%0A    %09int len = new Solution().removeElement(ary, 3);%0A    %09System.err.println(%22len = %22 + len);%0A    %09for(int i = 0; i %3C len; i++)%7B%0A    %09%09System.err.print(ary%5Bi%5D + %22, %22);%0A    %09%7D%0A    %09System.err.println(%22%22);%0A    %7D%0A%7D%0A

Add java solution for 27. Remove Element