Question DSA-STR-0060
MediumWhat does the Z-algorithm compute for a string s?
- A.
The reverse of s
- B.
The longest palindrome
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Strings question
What does the Z-algorithm compute for a string s?
The reverse of s
The longest palindrome
Sign up free to see the answer and a step-by-step explanation.
For each position i, the length of the longest substring starting at i that matches a prefix of s
The number of vowels