class Solution {
public boolean canConstruct(String s, int k) {
int right = s.length();
int[] occ = new int[26];
for (int i = 0; i < right; i++){
occ[s.charAt(i) - 'a']++;
}
int left = 0;
for (int i = 0; i < 26; i++){
if (occ[i] % 2 == 1){
++left;
}
}
left = Math.max(left, 1);
return left <= k && k <= right;
}
}
02-15
353
07-14