Quite a simple problem: I have a list of integers, e.g.,
a = [7 8]
Now I want to have a seperate list, that contains the Hamming Weight (that is the number of 1 bits in the binary represenation) for each of the integers in the list. That means the result for the integer list above should look as follows:
res = [3 1]
Anyone an idea how I could do this quickly?