Easy Solution
Code\n\nclass Solution {\npublic:\n    vector<int> evenOddBit(int n) {\n        bool odd = false;\n        vector<int>ans(2,0);\n        while(n>0){\n          
# Code\n```\nclass Solution {\npublic:\n    vector<int> evenOddBit(int n) {\n        bool odd = false;\n        vector<int>ans(2,0);\n        while(n>0){\n            if(odd){\n                if(n&1) ans[1]++;\n                odd=false;\n            }\n            else{\n                if(n&1) ans[0]++;\n                odd=true;\n            }\n            n=n>>1;\n        }\n        return ans;\n    }\n};\n```
['C++']