0

HI EVERYONE,

I HAVE GOT A VERY INTERESTING PROBLEM THIS TIME. U HAVE TO FORM A PALINDROME OF AN ENTERED STRING. IT`S NOT THE UASUAL STUFF OF CHECKING WHETHER AN ENTERED STRING IS A PALINDROME OR NOT.

IN THIS PROGRAM, SAY IF THE GIVEN STRING IS:

"A3BCA"

THEN THE PROGRAM SHOULD FORM THE SHORTEST PALINDROME POSSIBLE BY INSERTING "CB3" AT THE SECOND LAST POSITION;

i.e; THE OUTPUT SHOULD BE

"A3BCCB3A"

OR THE OUTPUT CAN ALSO BE

"A3CBC3A"

OR

OR IF THE INPUT IS "AAMDM"

THEN THE SOLUTION IS "AAMDMAA" AND NOT "MDMAAMDM" B`COS WE HAVE TO FIND THE SHORTEST POSSIBLE PALINDROME.

SO, PLZ CAN ANY 1 HELP ME TO BEGIN IN THE RIGHT DIRECTION.