Monday, August 25, 2014

Optym Online Test: Shortest Palindrom

Given a string, Find minimum no of characters to be inserted to convert it to palindrome.
Input: ab
         aa
         abcd

Output:
     1 .  insertion to make it bab
     0   insertion to make it aa
     3   insertions to make it dcbabcd

No comments:

Post a Comment