August 6, 2008: Greetings, programmers! The 3rd DDP Programming Challenge has been opened before schedule. The challenge remains open until we receive a correct solution. Send your entries to:
Don't forget to mention your name. Multiple entries will not be accepted.
August 6, 2008: We have a winner! The 2nd DesDevPro Programming Challenge has been won by
Tasnim Khan
Thank you all for the overwhelming response we got for the 2nd Challenge. We hope you keep up the enthusiasm. Among all the correct solutions recieved, we chose the one that was not only the earliest correct solution, but also used a very brief and precise logic. Heartiest congratulations to the winner! We have got in touch with the winner. Details about the winner will be on display on the winner page shortly. The 3rd Programming Challenge will be opened on Aug 7, 2008
__________________________________________________________________________________________________________
Problem Statement
The input for your program will be a string which may (or may not) conatain a '?' sign (a mark of interrogation).
Your program should first ignore the '?' and find out whether the string is a palindrome or not. If the string is not a palindrome, but contains a '?' then your program should find the letter(s) which must be inserted in the place of '?' to make the string a palindrome (if possible). Then the resulting palindrome and the filling letter should be displayed in the output, separated by a TAB space. The last line of the input will be a '#' which should not be processed. If more than one palindrome can be generated then each result should be followed by a single space, an ampersand (&), another space and then the next result.
SAMPLE INPUT
MADAM
BL?B
QWE?RTY
BB?
#
SAMPLE OUTPUT
MADAM <null>
BLLB L
<none>
BB <null> & BBB B
In the first output, since MADAM is already a palindrome, <null> is printed as the filling character. For the last input, there are two results, properly separated as directed above.
NOTE:
You can assume that the input string will consist of only UPPERCASE letters apart from an optional ? sign. Only the last line will contain a # which should not be processed.
__________________________________________________________________________________________________________