Problem 1794 · Medium

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.

Open the interactive visualisation