Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1513. Number of Substrings With Only 1s
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.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.