```javaclassSolution {publicintsingleNumber(int[] nums) {int[] bits =newint[32];for (int x : nums) {for (int i =0; i <32;i++) { bits[i] += (x >> i)&1; // convert to binary } }int result =0;for (int i =0; i <32;i++) { result += (bits[i]%3)<<i; // convert back to decimal }return result; }}```