Palindrome Permutation
Practice
3.8 (16 votes)
Very Easy
Problem
79% Success 3446 Attempts 10 Points 1s Time Limit 256MB Memory 1024 KB Max Code

A String is called Palindrome if it reads the same backwards as well as forwards. For example, the String \(aba\) can be read the same backwards as well as forwards.
Now, a Permutation of a String S is some String K where S and K contain the same set of characters, however, these characters need not necessarily have the same positions. For Example, consider the String \(abc\). Here, the Strings :

  1. \(acb\)
  2. \(bca\)
  3. \(bac\)
  4. \(cab\)
  5. \(cba\)

are all permutations of it.

Now, given a String S consisting of lowercase English alphabets, you need to find out whether any permutation of this given String is a Palindrome. If yes, print "YES" (Without quotes) else, print "NO" without quotes.

Input Format:
The first and only line of input contains the String S.

Output Format:
Print the required answer on a single line

Constraints:
\( 1 \le |S| \le 1000 \)
\( S[i] \in [a,z] \)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
71 votes
Tags:
Data StructuresImplementationMedium
Points:20
36 votes
Tags:
Ad-HocApprovedData StructuresEasyImplementationOpen
Points:20
29 votes
Tags:
ApprovedBasic ProgrammingEasy
Editorial

No editorial available for this problem.