paulofelipefeitosa
Just a Latin American CS student.
Just a Latin American CS student.
is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
This problem is the same as Longest Palindromic Subsequence. Solved in O(N^2) and O(N^2) space.
- paulofelipefeitosa January 09, 2018The Longest Palindromic Subsequence key idea is, let's suppose that we want to know the longest subpalindrome of substring [1, n].
If the characters in position 1 and n are equals, then the answer is the longest subpalindrome of substring [2, n-1] + 2.
Else, the answer is the largest subpalindrome between substrings [1, n-1] and [2, n].
Note that, if there is more than one subpalindrome as answer we can pick any, because we will always build the largest subpalindrome. Therefore, substrings of size <= 2 are always palindrome.