One Liner
We can count each bit, which would make sense if we have a stream of bits.\n\nFor an integer, we can just mask old and even bits (using bitwise AND), and use po
We can count each bit, which would make sense if we have a stream of bits.\n\nFor an integer, we can just mask old and even bits (using bitwise AND), and use `popcount` to count remaining bits.\n\n**Java**\n```java\npublic int[] evenOddBit(int n) {\n    return new int[] {Integer.bitCount(n & 0b0101010101), \n                      Integer.bitCount(n & 0b1010101010)};\n}\n```\n**C++**\n```cpp\nvector<int> evenOddBit(int n) {\n    return {__builtin_popcount(n & 0b0101010101), \n            __builtin_popcount(n & 0b1010101010)};\n}\n```\n**Python 3**\n```python\nclass Solution:\n    def evenOddBit(self, n: int) -> List[int]:\n        return [(n & 0b10101010101).bit_count(), (n & 0b01010101010).bit_count()]\n```
['C', 'Python', 'Java']