Easy JAVA Solution | Brute force
\n\n# Code\n\nclass Solution {\n    public int[] evenOddBit(int n) {\n        String bits=Integer.toBinaryString(n);\n        int odd=0;\n        int even=0;\n 
\n\n# Code\n```\nclass Solution {\n    public int[] evenOddBit(int n) {\n        String bits=Integer.toBinaryString(n);\n        int odd=0;\n        int even=0;\n        int count=0;\n        for(int i=bits.length()-1;i>=0;i--){\n            if(bits.charAt(i)==\'1\'){\n                if(count%2==0){\n                    even++;\n                }\n                else{\n                    odd++;\n                }\n            }\n            count++;\n        }\n        return new int[]{even,odd};\n    }\n}\n```
['Java']