Available question text
Count how many substrings of a given digit string represent base-10 numbers divisible by a given integer p. Solve by using modular arithmetic / rolling remainders (tracking prefix remainders with powers of 10, and handling small-special-case divisors like 2 or 5) to avoid constructing large integers and achieve linear-time counting.
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 2950. Number of Divisible Substrings
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source