You are given a text T and a pattern P.
Let the set S be such that it contains all the starting positions of occurences of pattern P in T. (1 - indexed).
For example if T = aaaa and P = a than S = {1,2,3,4}.
If T=abab and P = ab than S = {1,3}.
You have to find out the number of ways to choose some numbers from the set S such that the product of chosen numbers is divisible by all the numbers from 1 to 9 modulo 10^9+7.
I am unable to approach this question…