 New update is available. Click here to update.

# Divisible Substrings

Easy 0/40
Avg time to solve 15 mins
Success Rate 75 % Share 1 upvotes

## Problem Statement

#### Note :

``````A substring can start with a zero. The given number may also contain leading zeroes.
``````

#### Example:

``````‘S'= ‘5203’

Here, four substrings are divisible by 5: ‘5’, ’520’, ‘20’, ‘0’.
``````
Detailed explanation ( Input/output format, Notes, Images ) ##### Constraints :
``````1 <= 'T' <= 10
1 <= 'N' <= 10^5
'0' <= 'S[i]' <= '9'

Time Limit: 1 sec
``````
##### Sample Input 1 :
``````2
5
35602
3
100
``````
##### Sample Output 1 :
``````6
5
``````
##### Explanation Of Sample Input 1 :
``````For test case 1:

‘S'= ‘35602’
Here, six substrings are divisible by 5: ‘35’, ’3560’, ‘5’, ‘560’, ‘60’, ‘0’.

For test case 2:

‘S'= ‘100’
Here, five substrings are divisible by 5: ‘10’, ’100’, ‘0’, ‘00’, ‘0’.
``````
##### Sample Input 2 :
``````2
1
9
4
1555
``````
##### Sample Output 2 :
``````0
9
``````  Auto Console