[LeetCode] 1680. Concatenation of Consecutive Binary Numbers

    [LeetCode] 1680. Concatenation of Consecutive Binary Numbers

    1680. Concatenation of Consecutive Binary Numbers Medium Given an integer n, return the decimal value of the binary string formed by concatenating the binary representations of 1 to n in order, modulo 109 + 7. Example 1: Input: n = 1 Output: 1 Explanation: "1" in binary corresponds to the decimal value 1. Example 2: Input: n = 3 Output: 27 Explanation: In binary, 1, 2, and 3 corresponds to "1", ..