349. Palindrome Permutation

Given a string s, return true if a permutation of the string could form a palindrome and false otherwise.

Example 1:

Input: s = "hello"

Output: false

Explanation: No permutation of "hello" forms a palindrome.

Example 2:

Input: s = "civic"

Output: true

Explanation: "civic" itself is a palindrome.

Now Your Turn!

Pick the correct output for the given input

Input: s = "racecar"

Still unsure what the problem is asking ?

Let’s go through a few more examples, step by step, to make it clearer.

Constraints:

  • 0 <= s.length <= 5000
  • s consists of only lowercase English letters.

Hints

Frequently Occurring Doubts

Interview Follow-up Questions

0
class Solution {
public:
bool canPermutePalindrome(string s) {
// Your code goes here
}
};
Test Case

Input:

S