Each lowercase English letter is mapped to a number as follows:
'a' and 'b' map to
'c', 'd', and 'e' map to
'f', 'g', and 'h' map to
'i', 'j', and 'k' map to
'l', 'm', and 'n' map to
'o', 'p', and 'q' map to
'r', 's', and 't' map to
'u', 'v', and 'w' map to
'x', 'y', and 'z' map to
A substring is called divisible if the sum of the mapped values of its characters is divisible by the length of the substring.
Given a string word, return the number of divisible substrings in word.
Constraints:
word.length
word consists only of lowercase English letters.
Each lowercase English letter is mapped to a number as follows:
'a' and 'b' map to
'c', 'd', and 'e' map to
'f', 'g', and 'h' map to
'i', 'j', and 'k' map to
'l', 'm', and 'n' map to
'o', 'p', and 'q' map to
'r', 's', and 't' map to
'u', 'v', and 'w' map to
'x', 'y', and 'z' map to
A substring is called divisible if the sum of the mapped values of its characters is divisible by the length of the substring.
Given a string word, return the number of divisible substrings in word.
Constraints:
word.length
word consists only of lowercase English letters.