Python Hamming Weight Leetcode Javascript Practice