1
# Runtime: 947 ms (Top 34.04%) | Memory: 15.5 MB (Top 30.97%)
2
class Solution:
3
def totalHammingDistance(self, arr: List[int]) -> int:
4

5
total = 0
6
for i in range(0, 31):
7
count = 0
8
for j in arr:
9
count += (j >> i) & 1
10
total += count * (len(arr) - count)
11
return total

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0