#3448

Count Substrings Divisible By Last Digit

international master · 2150 · lc hard +32 · 23% accepted · 78 likes · top 3%

Description

Given a string s made up of digit characters, count how many of its substrings are evenly divisible by their final digit (which must be non-zero).

Note: Substrings may have leading zeros.

Code

1
2
3