@@ -0,0 +1,731 @@
+/**%0A *%09Given an array of integers, every element appears three times except for one. %0A *%09Find that single one.%0A *%0A *%09Author: matao%0A *%0A */%0A%0Apublic class SingleNumberII %7B%0A%09public static int singleNumber(int%5B%5D nums) %7B%0A%09%09if (nums == null %7C%7C nums.length == 0) %7B%0A            return -1;%0A        %7D%0A        int result=0;%0A        int%5B%5D bits=new int%5B32%5D;%0A        for (int i = 0; i %3C 32; i++) %7B%0A            for(int j = 0; j %3C nums.length; j++) %7B%0A                bits%5Bi%5D += nums%5Bj%5D %3E%3E i & 1;%0A                bits%5Bi%5D %25= 3;%0A            %7D%0A%0A            result %7C= (bits%5Bi%5D %3C%3C i);%0A        %7D%0A        return result;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A    %09int%5B%5D nums = %7B1, 1, 1, 2%7D;%0A    %09System.out.println(singleNumber(nums));%0A    %7D%0A%7D

add single number II solution