NEED HELP ASAP with C Lang
#1

A palindrome is a string which reads the same forward and backwards. You are provided a function shortPalin which accepts a string S.
You are required to form a palindrome by adding 0 or more characters to the string at any location which you find appropriate. Return the minimum number of characters which needs to be added to the string to transform it into a palindrome. The section of the program which parses the input and displays the output will be handled by us. Your task is to complete the body of the function or method provided, and to return the correct output.

Sample input #00:
String(S):abab

Sample output #00:
1

Explanation:
A palindrome can be obtained by simply adding an 'a' to the string to form 'ababa'.

Sample input #01:
String(S): abacaba
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)