Bit Manipulation Leetcode Problems Python