Pocket Gems Interview Question

Count the number of set bits in a 32 bit integer.