DIY: Palindrome Permutation

Solve the interview question "Palindrome Permutation" in this lesson.

Problem statement

You are given a string, str. Your task is to find whether or not a permutation of this string is a palindrome. You should return true if such a permutation is possible and false if it is not possible.

Input

The input is a string. The following are examples of input to the function:

// Sample Input 1
"peas"

// Sample Input 2
"abab"

Output

The output will either be true or false. The following are examples of the outputs:

// Sample Output 1
false

// Sample Output 2
true

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.