#K50727. Can Form Palindrome
Can Form Palindrome
Can Form Palindrome
You are given a string s
consisting only of lowercase English letters. Your task is to determine whether the characters of s
can be permuted to form a palindrome.
A palindrome is a word that reads the same backward as forward. For a string to be rearranged into a palindrome, at most one character can have an odd frequency (which would be the middle character in an odd-length palindrome), and all other characters must appear an even number of times.
Input Example: ivicc
Output Example: True
Write a program that reads an input string from stdin
and prints True
if the string can be rearranged to form a palindrome, or False
otherwise.
inputFormat
The input consists of a single line containing a non-empty string s
composed of lowercase English letters.
outputFormat
Output a single line containing True
if the palindrome permutation is possible, and False
otherwise.
a
True