Python Hamming Weight Leetcode Solutions Java