Count Pairs of Equal Substrings With Minimum Difference
Compare every start in s with every start in t, keep the smallest index gap among matching letters, and count the pairs that reach it.
Compare every start in s with every start in t, keep the smallest index gap among matching letters, and count the pairs that reach it.