Simple C# solution
Approach\n- Maintain two integer variables, even and odd, to count the number of even and odd indices in the binary representation of integer n.\n- Divide n by 
# Approach\n- Maintain two integer variables, `even` and `odd`, to count the number of even and odd indices in the binary representation of integer n.\n- Divide `n` by 2 while `n` is positive, and if `n modulo 2` is `1`, add `1` to its corresponding variable.\n\n# Complexity\n- Time complexity: $$O(n)$$\n- Space complexity: $$O(1)$$\n\n# Code\n```\npublic class Solution\n{\n    public int[] EvenOddBit(int n)\n    {\n        var even = 0;\n        var odd = 0;\n\n        while (n > 0)\n        {\n            if (n % 2 == 1)\n            {\n                ++even;\n            }\n\n            n /= 2;\n\n            if (n % 2 == 1)\n            {\n                ++odd;\n            }\n\n            n /= 2;\n        }\n\n        return new[] {even, odd};\n    }\n}\n```
['C#']