binary gap
function binaryGap(N) {
const bin = (N >>> 0).toString(2);
const gap = bin.substring(0, bin.lastIndexOf('1'));
const arr = substr.split('1');
return arr.sort().reverse()[0].length;
}
binaryGap(1041);
binary gap
function binaryGap(N) {
const bin = (N >>> 0).toString(2);
const gap = bin.substring(0, bin.lastIndexOf('1'));
const arr = substr.split('1');
return arr.sort().reverse()[0].length;
}
binaryGap(1041);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us