function flipBitToWin(number) {
  // keep two counters for previous and current ones
  let previous = 0;
  let current = 0;
  let max = 0;

  while(number > 0) {
    if(number & 1) {
      current++;
    } else {
      if(previous > 0) {
        max = Math.max(current + previous + 1, max);
      }

      previous = current;
      current = 0;
    }

    number >>= 1;
  }

  if(previous > 0) {
    max = Math.max(current + previous + 1, max);
  } else {
    max = Math.max(current, max);
  }

  return max;
}
5.3 Flip Bit to Win: You have an integer and you can flip exactly one bit from a 0 to a 1. Write code to find the length of the longest sequence of 1syou could create.

 EXAMPLE

 Input: 1775 (or: 11011101111)
 Output: 8
@param number