Total Hamming Distance

Given an integer array nums, compute the total Hamming distance across all unordered pairs of elements. The Hamming distance between two integers is the number of positions at which their bits differ. Return the sum of all pairwise Hamming distances.

Examples
Input: [4,14,2]
Output: 6
Hints

Total Hamming Distance

Given an integer array nums, compute the total Hamming distance across all unordered pairs of elements. The Hamming distance between two integers is the number of positions at which their bits differ. Return the sum of all pairwise Hamming distances.