3141. Maximum Hamming Distances
Given an array
nums
and an integerm
, with each elementnums[i]
satisfying0 <= nums[i] < 2m
, return an arrayanswer
. Theanswer
array should be of the same length asnums
, where each elementanswer[i]
represents the maximum Hamming distance betweennums[i]
and any other elementnums[j]
in the array.The Hamming distance between two binary integers is defined as the number of positions at which the corresponding bits differ (add leading zeroes if needed).
c++
1 |
|