```
public boolean canPermutePalindrome(String s) {
boolean[] idxArr = new boolean[256];
Arrays.fill(idxArr, true);
int oddCount = 0;
for(int i=0; i<s.length(); i++){
int idx = (int) s.charAt(i);
idxArr[idx] = !idxArr[idx];
if(idxArr[idx]){
oddCount --;
}
else{
oddCount ++;
}
}
// if s is odd length the odd count should be 1 else it should be 0
return (s.length() % 2 == 0) ? oddCount == 0 : oddCount == 1;
}
```