Search
⌘K

Leetcode 868. Binary Gap

Find the maximum distance between consecutive 1 bits in the binary representation of n by locating the positions of 1s and returning the largest difference between adjacent 1 positions (or 0 if fewer than two 1s).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.