Number of Divisible Substrings (For MLE)

Problem Overview

  • Count substrings whose mapped-letter sum is divisible by the substring’s length.
  • Input: lowercase string s (1–2000 chars) with each letter mapped to a digit; output: the count of such substrings.
  • A substring is any contiguous non-empty segment; use the provided letter-to-digit mapping.
  • String-processing/encoding context; a Wayfair coding interview problem and common interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: