Monday, July 25, 2016

Build a palindrome - HackerRank world codesprint #5

July 25, 2016

Read the problem statement more than 30 minutes:

Build a palindrome - problem statement is here


Try to come out the idea to solve the problem first. (Advanced problem) - Learning starts from reading the analysis. Prepare for advanced level challenges from HackerRank, one by one.

Read the editorial notes:

editorial notes


Here are a list terms to review:

1. Consider that >= (L+1)/2 characters are present in the first string.
2. string hashing/ a palindromic tree
3. Iterate on each index i of the given string a and consider the longest palindrome starting from i as a part of your solution to find the maximum length possible, L, for string s.
4. Suffix array
5. LCP - largest common prefix array

Required Knowledge: Suffix Array, Palindromic Tree, String Hashing, Implementation

one selected code to study - Just use it as an example to motivate herself to work hard one by one on small topic, and then, one day in the future, build complicated stuff like this challenge. 

C# code to study


Java code to study


C++ code to study


Previous blog about suffix array

Follow up after 6 months


March 26, 2017

Format the style of the blog, clean up web links and make the web links readable.




No comments:

Post a Comment