Interview Query

Permutation Palindrome

Upvote
9
Downvote
Save
Mark Completed
Have you seen this question before?

Given a string str, write a function perm_palindrome to determine whether there exists a permutation of str that is a palindrome.

Example:

Input:

str = 'carerac'
def perm_palindrome(str) -> True

“carerac” returns True since it can be rearranged to form “racecar” which is a palindrome.

Next question: Youtube Recommendations
.....
Loading editor
Use Shift + Enter to run

Comments

Loading comments