Dsa
Hashing
Medium
Count Unique Substrings
Given a string, count the number of unique substrings within it. A substring can be any continuous portion of the string. The substring should be considered unique based on its content and order.
Input Format:
A single line containing a string of lowercase alphabets, with length up to 1000.
Output Format:
Print an integer representing the count of unique substrings.
Example:
Input:
abcab
Output:
9
Key concepts
hashingsubstringscounting
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