def countBitsSum(arr): return sum([bin(a^b).count("1") for a,b in itertools.combinations(arr,2)])