Read a single character from ‘A’ through ‘Z’ and produces output in the shape of a pyramid composed of the letters up to and including the letter that is input.
The top letter in the pyramid should be ‘A’, and on each level, the next letter in the alphabet should fall between two copies of the letter that was introduced in the level above it.
For example, if the input is ‘E’,the output looks like the following:
A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
Thanks in advance!!