008 Prefix Palindrome

implement the following algorithm:

get the longest prefix of given string s, who is also a palindrome.
if the prefix we choose has at least two characters, we cut this prefix from s, and update s. repeat step one

so in all, this means, keep doing this algorithm until there is non prefix palindrome left(only contains one letter)

posted @ 2020-12-22 01:40  EvanMeetTheWorld  阅读(9)  评论(0)    收藏  举报