> For the complete documentation index, see [llms.txt](https://timmybeeflin.gitbook.io/cracking-leetcode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://timmybeeflin.gitbook.io/cracking-leetcode/bit/2275.-largest-combination-with-bitwise-and-greater-than-zero-and-1-greater-than-greater-than-1.md).

# 2275. Largest Combination With Bitwise AND Greater Than Zero (&1, >>= 1 )

```
T: O(n*32)
```

```java
class Solution {
    public int largestCombination(int[] candidates) {
        int[] bitCount = new int[32];
        for (int num : candidates) {
            int i = 0;
            while (num > 0) {
                int isOne = num & 1;
                num >>= 1;
                bitCount[i++] += isOne;
            }
        }
        int result = 0;
        for (int c : bitCount) {
            result = Math.max(result, c);
        }
        return result;
    }
}

/**
421 
001
101
011

how to make result > 0, the larget number of the bit is 1 at the same position! T: O(n*32)
  10000
  10001
1000111
 111110
   1100
  11000
   1110


 */
```
