To calculate the longest binary gap (sequence of '0' in a number's binary representation). Ex: input x = 1041. Output: 5, because there are 5 of 0 in 10000010001.
Sigiloso
In javascript const num = 1041 const max = num.toString(2).split('1').reduce((max, n) => (max === undefined || n.length > max ? n.length : max))