Hello codeforces recently I've met the following problem https://codeforces.me/gym/101856/problem/B (problem B, Breaking the Curse).
For those who are too lazy to go through the link I will try to explain the problem as briefly as possible: We are given the two string $$$S, T$$$ and $$$Q$$$ queries. Queries are described by two integers $$$L$$$ and $$$R$$$, as a response we should print the number of intervals $$$i, j$$$ such that $$$L ≤ i ≤ j ≤ R$$$ and $$$S[i...j]$$$ is the substring of $$$T$$$.
Can someone give a hint or idea how to solve this ? (I would like to know the solution with Suffix Array:) )








