В чем ошибка?
package com.javarush.task.task39.task3908;
import java.util.HashSet;
public class Solution {
public static void main(String[] args) {
// System.out.println(isPalindromePermutation("22212"));
}
public static boolean isPalindromePermutation(String s) {
if (s == null || s.length() == 0) return false;
String s2 = s.toUpperCase();
char[] ch = s2.toCharArray();
int coin = 0;
int coinTrue = 0;
int coinFalse = 0;
HashSet<Character> h = new HashSet<Character>();
for (int i = 0; i < ch.length; i++) {
h.add(ch[i]); }
for (Character h1:h) {
for (int i = 0; i <ch.length ; i++) {
if (h1==ch[i]){
coin++;
}
}
if (coin%2==0){
coinTrue++;
}
else if (coin%2!=0){
coinFalse++;
}
coin=0; }
if (coinFalse==1){
return true; }
else {
return false; }
}
}