Python Hamming Weight Leetcode