Tap here to switch tabs
Problem
Submissions

Problem: Number of Distinct Substrings in a String

Number of Distinct Substrings in a String asks you to count the different contiguous substrings of a given string, counting each substring only once even when it appears multiple times.

Statement

Given a string s, return the number of distinct substrings in s.

A substring is a contiguous sequence of characters within a string.

Constraints:

  • 1≤1 \le s.length ≤500\le 500

  • s consists of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Distinct Substrings in a String

Number of Distinct Substrings in a String asks you to count the different contiguous substrings of a given string, counting each substring only once even when it appears multiple times.

Statement

Given a string s, return the number of distinct substrings in s.

A substring is a contiguous sequence of characters within a string.

Constraints:

  • 1≤1 \le s.length ≤500\le 500

  • s consists of lowercase English letters.