Free written solution

Concatenation of Consecutive Binary Numbers (LeetCode 1680): Solution and Explanation

Glue the binary forms of 1 through n into one bit string and return its value modulo 10^9 + 7.

Read the intuition, approach, code and complexity →