This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static boolean isPalindromePerm(String s) { | |
int checker = 0; | |
for (char c : s.toCharArray()) { | |
if ('a' <= c && c <= 'z') { | |
int val = c - 'a'; | |
int mask = 1 << val; | |
if ((checker & mask) == 0) { | |
checker |= mask; //flip to 1 | |
} else { | |
checker &= ~mask; //flip to 0 |