Find the missing letter in the palindrome

Jul 15, 2017 at 6:47am
A string which is a palindrome but has one letter missing will be passed as input. The program must print the missing letter.
Example Input and Output:
If the input is madm the output must be a (madam)
If the input is abcdcb the output must be a (abcdcba)
If the input is mikkm the output must be i (mikkim)
Boundary Conditions: The length of the string will be between 2 and 100.
Input Format: The string will be passed as a single line/input argument via the standard input.
Output Format: The missing letter must be printed to the standard console.
Jul 15, 2017 at 7:31am
This isn't a code writing service here.
You should make some effort not just dumping the exercise here.
Jul 15, 2017 at 7:44am
here's an idea,
find the number of string's length when divided by 2
have a string that accepts half of string...
the rest is up to ya
Jul 15, 2017 at 7:51am
Seems like a flawed question.

Input: abca

Was the original palindrome abcba (missing letter b)
or was it acbca (missing letter c)?
Jul 15, 2017 at 10:18am
yeah...if it has this rules (only the right part is wrong) then this will be a great homework for me...regardless it appears like I failed at making the code for this question (I used Dlang which string is immutable ??)
Jul 15, 2017 at 10:45am
@lastchance,
does it matter which letter is missing? Just could just use the first one you find.
Jul 15, 2017 at 11:28am
Well I was going from the first example, saying: output must be a, whereas I could choose either a or d, giving palindromes madam or mdadm respectively.

Maybe the OP hasn't given us the whole question ...
Topic archived. No new replies allowed.