Write a function that takes an unsigned integer and returns the number of '1' bits it has (also known as the ).
Input: 11
Output: 3
Explanation: Integer 11 has binary representation 00000000000000000000000000001011
class Solution(object):
def hammingWeight(self, n):
AnswerINT = 0
while(n):
if(n%2):
AnswerINT += 1
n = n // 2
return AnswerINT