Key points:

Using Boolean to count the appearance of each char is enough since we only need to know it is odd or even.

When counting numbers of odd char, +1 when odd, 1 when even within each iteration.
public class Solution {
public boolean canPermutePalindrome(String s) {
int len = s.length();
if (len <= 1) return true;
boolean[] isodd = new boolean[256];
int odds = 0;
for ( char c: s.toCharArray() ) {
isodd[c] = !isodd[c];
if ( isodd[c] ) {
odds++;
} else {
odds;
}
}
return odds <=1 ;
}
}