Largest Combination With Bitwise AND Greater Than Zero LeetCode solution in JavaScript
1var largestCombination = function (candidates) {2const indexArr = Array(24).fill(0);34for (let candidate of candidates) {5let index = 0;6while (candidate > 0) {7if ((candidate & 1) === 1) indexArr[index] += 1;8candidate >>>= 1;9index++;10}11}1213return Math.max(...indexArr);14};