Skip to content

Latest commit

 

History

History
8 lines (5 loc) · 219 Bytes

File metadata and controls

8 lines (5 loc) · 219 Bytes

Question

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 1s you could create.

Example

  • Input: 1775 (or 11011101111)
  • Output: 8