You are viewing a single comment's thread. Return to all comments →
JS
function main() { const n = parseInt(readLine().trim(), 10); const b = n.toString(2); const myArray = b.split('0').map((x) => x.length); console.log(Math.max(...myArray)); }
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 →
JS