Sale
Summer Offer: $190/yr $99/yr
00 : 00 : 00 : 00
Get this deal
Backend Engineer Senior programming

You need to write a function that will return whether a single string can be rearranged to form a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization).


Constraints:


  • 1 <= s.length <= 2000

  • The input string consists of lowercase alphabetic characters only.


Examples:


1. Input: s = "civic"
Output: true
2. Input: s = "ivicc"
Output: true
3. Input: s = "hello"
Output: false
Suggested Answer

Trusted by 100+ professionals preparing for interviews

Trusted by 100+ professionals 50+ Company Question Banks 5+ Supported Languages

Practice More Questions Like This

Generate unlimited interview questions with structured answers, code runner, and AI-powered walkthroughs.

Get Started Free
Link copied to clipboard