Anagram Palindrome
Basic Accuracy: 54.0% Submissions: 4777 Points: 1

Given a string S, Check if characters of the given string can be rearranged to form a palindrome. 

Example 1:

S = "geeksogeeks"
Output: Yes
Explanation: The string can be converted
into a palindrome: geeksoskeeg

​Example 2:

S = "geeksforgeeks"
Output: No
Explanation: The given string can't be
converted into a palindrome.

Your Task:
You don't need to read input or print anything. Your task is to complete the function isPossible() which takes the string S as input and returns 1 if the string can be converted into a palindrome. Else, it returns 0.

Expected Time Complexity: O(|S|).
Expected Auxiliary Space: O(Distinct Characters).

1 <= |S| <= 106

We are replacing the old Disqus forum with the new Discussions section given below.
Click here to view old Disqus comments.

to report an issue on this page.


We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?


All Submissions

My Submissions:

Login to access your submissions.

Anagram Palindrome

Output Window