GeeksforGeeks » Interview Questions

Interview Question for Software Engineer/Developer about Algorithms, Strings

(3 posts)
  1. chuck
    guest
    Posted 4 months ago #

    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

  2. lalit
    guest
    Posted 4 months ago #

    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.

  3. gaurav
    guest
    Posted 4 months ago #

    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.

RSS feed for this topic