Palindrome
Palindromes are a very common type of problem in programming interviews, as well as competitive programming.
You can actually reverse a palindrome mathematically:
I tend to struggle with Palindrome problems. Going to include some template code to solve these problems:
- Longest Palindromic Subsequence
- Longest Palindromic Substring
Longest Palindromic Substring
I actually could not come up with a solution.
Longest Palindromic Sequence
From MIT 6.046: https://www.youtube.com/watch?v=Tw1k46ywN6E&list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp&index=14&ab_channel=MITOpenCourseWare - 16:20
My solution on Leetcode
Concepts