Problem Description:
Given an array of integers, every element appears three times except for one. Find that single one.
Solution:
1 Arrays.sort(A); 2 for (int i = 2; i < A.length; i += 3) { 3 if (A[i] != A[i-2]) { 4 return A[i-2]; 5 } 6 } 7 8 return A[A.length - 1];
Problem Single Number II,布布扣,bubuko.com
原文:http://www.cnblogs.com/liew/p/3815080.html