GeeksforGeeks » Interview Questions
Interview Question for Software Engineer/Developer about Algorithms, Strings
(3 posts)-
Given a word, convert it into a Palindrome with minimum addition of letters to it. letters can be added anywhere in the word. for eg if hello is given, result should be hellolleh
-
As a starting point, you can reverse the string and attach the reversed string at the end of the original string. For hello, you get helloolleh. Now you can try removing characters one by one such that the total number of instances for the removed character is at least same as the original string.
-
find the lcs (longest common sub) of a given str and its reverse.
ans=str.length()-lcs(str,str.reverse)
Reply
You must log in to post.