Bit Manipulation Leetcode Problems Javascript Error