Easy and simplest aproach , Easy to understand
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```javascript []\n/**\n * @param {number} num\n * @return {number}\n */\nvar findComplement = function(num) {\n    let b = num.toString(2).split(\'\')\n    for(let i = 0 ; i < b.length ; i++){\n        if(b[i]== \'1\'){\n            b[i]=\'0\'\n        }else{\n            b[i]=\'1\'\n        }\n    }\n    console.log(b)\n    return parseInt(b.join(\'\'),2)\n   \n};\n```
['TypeScript', 'JavaScript']