Available question text
Given a binary array, return for each prefix whether the integer value of that binary prefix is divisible by 5. The key is to update the running value modulo 5 as you append bits to avoid large numbers (n up to 10^5).
Related questions
Continue with questions that share topics or the same question type.
- Number of Times Binary String Is Prefix-Aligned
Coding
- Add Binary
Coding · Bit Manipulation · Math · Simulation
- All Divisions With the Highest Score of a Binary Array
Coding
- All Elements in Two Binary Search Trees
Coding
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 1018. Binary Prefix Divisible By 5
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source