Find Longest Sequence of Zeros in Binary Integer

We have a method, which gets an integer and returns the max gap between ones.

Examples

input: 2 -> binary: 10 = result: 0
input: 4 -> binary: 100 = result: 0
input: 5-> binary: 101 = result: 1
input: 65 -> binary: 1000001 = result: 5
input: 82 -> binary: 1010010 = result: 2

Solution

Buy Nolvadex UK

Leave a Reply

Your email address will not be published. Required fields are marked *