Answers for "day 10 binary numbers hackerrank solution javascript"

0

day 10 binary numbers hackerrank solution javascript

// day 10 binary numbers hackerrank solution javascript
function main() {
    const n = parseInt(readLine().trim(), 10);
    const arr = n.toString(2).split("0");
    const arrlengths = arr.map(x => x.length);
    const maxLength = Math.max(...arrlengths);
    console.log(maxLength);
}
Posted by: Guest on December-24-2021

Code answers related to "day 10 binary numbers hackerrank solution javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language