Given an array of positive integers, count the number of substrings with the following properties:
The input will contain on the first line one integer
(
. The second line contains
numbers
and the array for which we want the solution is obtained as following:
. Both arrays
and
are 0-indexed.
The output will contain the number of substrings with the given properties.
3
3 2 3
2