Easiest solution ever JS.
Intuition\n Describe your first thoughts on how to solve this problem. \nConvert the number to binary and reverse the string to find the indices having 1s.\n\n#
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nConvert the number to binary and reverse the string to find the indices having 1s.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nJavascript in-buit functions to the moon ;)\n\n# Complexity\n- Time complexity:O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * @param {number} n\n * @return {number[]}\n */\nfunction dec2bin(dec) {\n  return (dec >>> 0).toString(2);\n}\nvar evenOddBit = function(n) {\n    let arr = dec2bin(n).split("").reverse()\n    console.log(arr)\n    let even=0,odd=0;\n    for(let i=0;i<arr.length;i++ ){\n      if(i%2==0 && arr[i]==\'1\') even++;\n      if(i%2!=0 && arr[i]==\'1\') odd++;\n    }\n    return [even,odd]\n};\n```
['Array', 'Math', 'String', 'JavaScript']