🚀Beats 💯%||Java & C++ || Easiest
JAVA\n\npublic int[] evenOddBit(int n) {\n        int x=1<<9;    // as 1<=n<=1000 is given in constraints\n\t\tint even=0,odd=0;\n\t\tint i=0;\n\t\tint [] ans =
**JAVA**\n```\npublic int[] evenOddBit(int n) {\n        int x=1<<9;    // as 1<=n<=1000 is given in constraints\n\t\tint even=0,odd=0;\n\t\tint i=0;\n\t\tint [] ans = new int[2];\n\t\twhile(i<10)\n\t\t{\n\t\t\tif((n&x)>0 && i%2==0)\n\t\t\t\todd++;\n\t\t\telse if((n&x)>0 && i%2==1)\n\t\t\t\teven++;\n\t\t\ti++;\n\t\t\tx=x>>1;\n\t\t}\n\t\tans[0]=even; ans[1]=odd;\n\t\treturn ans;\n\t}\n```\n**C++**\n\n```\nvector<int> evenOddBit(int n) {\n\t\tint x=1<<9;    // as 1<=n<=1000 is given in constraints\n\t\tint even=0,odd=0;\n\t\tint i=0;\n\t\twhile(i<10)\n\t\t{\n\t\t\t\tif((n&x) && i%2==0)\n\t\t\t\t\t odd++;\n\t\t\t\telse if((n&x) && i%2==1)\n\t\t\t\t\t even++;\n\t\t\t\ti++;\n\t\t\t\tx=x>>1;\n\t\t}\n\t\treturn {even,odd};\n}\n```\n**THANK YOU**
['C++', 'Java']