#C8912. Special Palindrome String
Special Palindrome String
Special Palindrome String
You are given a string s
. Your task is to determine whether it is possible to rearrange the characters of s
such that it forms a special string. A special string is defined as a palindrome that contains at least three unique characters.
A palindrome is a string that reads the same forwards and backwards. However, even if a palindrome can be formed from the characters of s
, the additional condition of having at least three distinct characters must be met.
If both conditions are satisfied, print "It's special!
"; otherwise, print "Sorry, try again!
".
Note: Reordering of characters is allowed.
inputFormat
The input consists of a single line containing the string s
.
outputFormat
Output a single line containing either "It's special!
" if it is possible to rearrange the string into a palindrome with at least three unique characters, or "Sorry, try again!
" otherwise.
ABBACBCBA
It's special!