
Palindrome Permutation (easy)
Problem Statement
Given a string s, return true if any permutation of the given string s can form a palindromic string. Otherwise, return false.
A palindrome is a word, phrase, number, or other sequences of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization).
Examples
-
Example 1:
- Input:
"tactcoa" - Expected Output:
true - Justification: The string can be rearranged to form "tacocat", which is a palindrome.
- Input:
-
Example 2:
- Input:
"abcde" - Expected Output:
false - Justification: There is no possible rearrangement of these characters that would result in a palindrome.
- Input:
-
Example 3:
- Input:
"aabbccdd" - Expected Output:
true - Justification: The string can be rearranged as "abcddcba", which is palindromes.
- Input:
Try it yourself
Try solving this question here:
Python3
Python3
. . . .
.....
.....
.....
Unlock this and all other premium problems.
No code editor for this lesson
This lesson focuses on concepts and theory