You are viewing a single comment's thread. Return to all comments →
function main() { const n = parseInt(readLine().trim(), 10); var bn = n.toString(2) const re = /(1)+/g; const arr = [...bn.matchAll(re)] var arrl = 0 for(var i=0;i<arr.length;i++){ if(arr[i][0].length>arrl){ arrl = arr[i][0].length }
} console.log(arrl)
}
Seems like cookies are disabled on this browser, please enable them to open this website
Day 10: Binary Numbers
You are viewing a single comment's thread. Return to all comments →
}