Palindrome
Problem
At the input of the program are uppercase Latin letters, the input of these characters ends with a dot. Write a time and memory efficient program that will determine whether these letters can be rearranged to form a palindrome (a palindrome reads the same from left to right and from right to left). The program should output the answer "Yes
" or "No
", and in the case of the answer "Yes", – also the resulting palindrome itself (first in alphabetical order).
Input string example:
GANN.
Sample output:
Yes
ANGNA