Search
⌘K

Leetcode 1698. Number of Distinct Substrings in a String

Count the number of distinct substrings of a given string. Efficient solutions use suffix automata or suffix array + LCP (or rolling hashes) to avoid quadratic enumeration and run in O(n)–O(n log n) time for large n.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.