Problem: Given a string of characters, find the longest palindromic substring.
Video tutorial: AMAZON CODING INTERVIEW - LONGEST PALINDROMIC SUBSTRING with Dynamic Programming (LeetCode) - YouTube
Problem: Given a string of characters, find the longest palindromic substring.
Video tutorial: AMAZON CODING INTERVIEW - LONGEST PALINDROMIC SUBSTRING with Dynamic Programming (LeetCode) - YouTube
Its a nice problem in Mixt-Dynamic-Programming
And hashing can do it trivially in O(N * logN), so what’s the point here? If an O(N ^ 2) solution is allowed then literally anyone can come up with somethin’ like this.
Can be done in O(n) using manachers algorithm.
Be honest here who remembers its implementation?
i have watched videos on manachar’s algorithm but i couldn’t figure out how to code that algorithm, can you please help me by posting the code and help me understand it ?