Problem 1698 · Medium

Number of Distinct Substrings in a String

Count how many different nonempty substrings a string contains. The visual lists distinct substrings as they are first seen and marks repeats that add nothing.

Open the interactive visualisation