The Challenge
Given a list of integers, the "bittiest" number among them is the one with the most bits on - that is, the largest amount of bits set to 1 in its 32-bit two's complement representation.
Write a function (or a program) that takes as input a list of integers between \$ -2^{31} \$ and \$ 2^{31}-1 \$ (the range of 32-bit signed integers) and returns as output the "bittiest" number among them.
You may assume the list has at least one item.
Test Cases
1, 2, 3, 4 => 3
123, 64, 0, -4 => -4
7, 11 => either 7 or 11
1073741824, 1073741823 => 1073741823
Good Luck!
This is code golf, so the shortest program in bytes wins.
-2^31
and2^31-1
, and we output one whose 32-bit signed representation has the most 1's. \$\endgroup\$