You are given a word of length n consisting of numeric digits, and a positive integer m.
The divisibility array div of word is an integer array of length n where:
div[i] = 1 if the numeric value represented by the prefix word[0...i] is divisible by m
div[i] = 0 otherwise
Return the divisibility array of word.
Constraints:
word.length
word consists of digits from
You are given a word of length n consisting of numeric digits, and a positive integer m.
The divisibility array div of word is an integer array of length n where:
div[i] = 1 if the numeric value represented by the prefix word[0...i] is divisible by m
div[i] = 0 otherwise
Return the divisibility array of word.
Constraints:
word.length
word consists of digits from