Given an integer array nums, calculate the total Hamming distance between every pair of distinct elements.
The Hamming distance between two integers is the number of bit positions at which their binary representations differ.
Return the sum of the Hamming distances for all unordered pairs of elements in nums.
Constraints:
nums.length
nums[i]
The result fits in a
Given an integer array nums, calculate the total Hamming distance between every pair of distinct elements.
The Hamming distance between two integers is the number of bit positions at which their binary representations differ.
Return the sum of the Hamming distances for all unordered pairs of elements in nums.
Constraints:
nums.length
nums[i]
The result fits in a