[c++ & Python] O(n) soution
\n Describe your approach to solving the problem. \n\n# Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O
\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# C++\n```\nclass Solution {\npublic:\n    vector<int> evenOddBit(int n) {\n        int even = 0, odd = 0, ind = 0;\n        while(n) {\n            if((ind & 1) && (n & 1)) odd++;\n            else if(n & 1) even++;\n            ind++;\n            n = n >> 1;\n        }\n        return {even, odd};\n    }\n};\n```\n\n# Python / Python3\n```\nclass Solution:\n    def evenOddBit(self, n: int) -> List[int]:\n        even = odd = ind = 0\n        while n:\n            if (ind & 1) and (n & 1):\n                odd += 1\n            elif n & 1:\n                even += 1\n            ind += 1\n            n = n >> 1\n        return [even, odd]\n```
['Bit Manipulation', 'Python', 'C++', 'Python3']