Question DSA-STR-0051
MediumWhich technique finds the longest palindromic substring in O(n²) time and O(1) space?
- A.
Expanding around each centre (2n − 1 centres)
- B.
Using a stack
- 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
Which technique finds the longest palindromic substring in O(n²) time and O(1) space?
Expanding around each centre (2n − 1 centres)
Using a stack
Sign up free to see the answer and a step-by-step explanation.
Sorting the string
Binary search