public boolean canPermutePalindrome(String s) {
        if (s == null) return false;

        int[] map = new int[256];
        for (int i = 0; i < s.length(); ++i) ++map[s.charAt(i)];

        int oddCnt = 0;
        for (int cnt : map) {
            if ((cnt & 1) == 1) ++oddCnt;
            if (oddCnt > 1) return false;
        }
        return oddCnt <= 1;
    }