← Amazon questions

Count substrings divisible by 8

Filed under Amazon

Given a large number string containing up to 10^5 digits, return the count of substrings divisible by 8. Substrings cannot start with '0' unless the substring is exactly '0'.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.