Given a string s consisting of digits, return the number of non empty substrings of s such that the numerical value represented by the substring is divisible by its last digit.
Note: A substring ending in
'0'is not divisible by its last digit because division byis undefined.
Constraints:
s.length
s consists of digits only.
Given a string s consisting of digits, return the number of non empty substrings of s such that the numerical value represented by the substring is divisible by its last digit.
Note: A substring ending in
'0'is not divisible by its last digit because division byis undefined.
Constraints:
s.length
s consists of digits only.