FastPrepPalindrome Permutation

Palindrome Permutation

Motive logoMotive● EasyFULLTIMEONSITE INTERVIEW
Learn

Problem statement

Given a lowercase English string s, return whether its characters can be rearranged into a palindrome.

Function

canPermutePalindrome(s: String) → boolean

Examples

Example 1

s = "code"return = false

Example 2

s = "aab"return = true

Constraints

  • 0 <= s.length <= 100000.
  • s contains lowercase English letters only.

More Motive problems

See Motive hiring insights
public boolean canPermutePalindrome(String s) {
  // write your code here
}
s"code"
expectedfalse
Checking account…