Available question text
Return the decimal value (mod 1e9+7) of the binary string formed by concatenating the binary representations of 1..n. The core challenge is to do this efficiently by appending each number using shifts/multiplication by 2^{bit-length} (bit-lengths increase at powers of two) rather than building the full string, with n up to 1e5.
Related questions
Continue with questions that share topics or the same question type.
- Binary Searchable Numbers in an Unsorted Array
Coding · Array · Binary Search · Monotonic Stack
- Binary Tree Longest Consecutive Sequence
Coding
- Binary Tree Longest Consecutive Sequence II
Coding
- Consecutive Numbers
Coding · Database
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1680. Concatenation of Consecutive Binary Numbers
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source