Available question text
Count how many substrings of a binary string consist entirely of '1's (return the result modulo 1e9+7). The core challenge is to compute, in linear time, the sum of L*(L+1)/2 over each contiguous run of L ones to handle strings up to 1e5 length and large counts.
Related questions
Continue with questions that share topics or the same question type.
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 1513. Number of Substrings With Only 1s
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source