1698. Number of Distinct Substrings in a String
https://leetcode.com/problems/number-of-distinct-substrings-in-a-string
Description
Given a string s
, return the number of distinct substrings of s
.
A substring of a string is obtained by deleting any number of characters (possibly zero) from the front of the string and any number (possibly zero) from the back of the string.
Example 1:
Example 2:
Constraints:
1 <= s.length <= 500
s
consists of lowercase English letters.
Follow up: Can you solve this problem in O(n)
time complexity?
ac
Previous1697. Checking Existence of Edge Length Limited PathsNext1699. Number of Calls Between Two Persons
Last updated