Dsa
Strings
Easy
Distinct Substring Count
Write a program that counts the number of distinct substrings in a given string. For the purpose of this problem, only non-empty substrings should be counted.
Example:
Input:
abc
Output:
6
Key concepts
stringssubstringsset operations
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now