Javascript Solution - without converting to binary
Let\'s look to rundom binary number, for example: 10011.\nReverse of this number = 01100.\nLook, it\'s equal: 100000 - 10011 - 1.\n\nIdea: find the minimum near
Let\'s look to rundom binary number, for example: `10011`.\nReverse of this number = `01100`.\nLook, it\'s equal: `100000 - 10011 - 1`.\n\n**Idea:** find the minimum nearest number greater than `num` (power of 2)\n\n```\n/**\n * @param {number} num\n * @return {number}\n */\nvar findComplement = function(num) {    \n    let d = 2;\n    while (d <= num) {\n        d *= 2;\n    }    \n    return d - num - 1;\n};\n```\n\nThe number of actions does not exceed 32.
['JavaScript']