Skip to content

1009-complement-of-base-10-integer

DevGod
DevGod
Elf Vtuber
/**
* @param {number} n
* @return {number}
*/
var bitwiseComplement = function(n) {
if(n==0){return 1;}
return ~n & ((1 << (32 - Math.clz32(n))) - 1);
};