🚨🔴Super Easy Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int[] evenOddBit(int n) {\n        int even=0;\n        int odd=0;\n        String str=Integer.toBinaryString(n);\n        String rev=reverse(str);\n        for(int i=0;i<rev.length();i++){\n            if(rev.charAt(i)==\'1\' && i%2==0){\n                even++;\n            }else if(rev.charAt(i)==\'1\' && i%2!=0){\n                odd++;\n            }\n        }\n        int ans[]=new int[2];\n        ans[0]=even;\n        ans[1]=odd;\n        return ans;\n    }\n    public String reverse(String str){\n        String rev="";\n        for(int i=0;i<str.length();i++){\n            char ch=str.charAt(i);\n            rev=ch+rev;\n        }\n        return rev;\n    }\n}\n```
['Java']