Fifteen Distinct Substrings
The suffixes of s = "banana" in sorted order:
| rank | start index | suffix |
|---|---|---|
| 0 | 5 | a |
| 1 | 3 | ana |
| 2 | 1 | anana |
| 3 | 0 | banana |
| 4 | 4 | na |
| 5 | 2 | nana |
lcp[i] is the longest common prefix of the suffixes at ranks i and i+1. The count of distinct substrings is
Which pair is right?
Sign in to answer questions and track your progress
Sign In