publicclassMain {privatestaticint solve(Stringstr) {if (str.length() ==0) {return0; }int length =str.length();char[] chs =str.toCharArray();int[] arr =newint[256];for (int i =0; i