#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
bool canConstruct(string s, int k) {
if(s.size() < k) return false;
if(s.size() == k) return true;
vector<int> freq(26, 0);
for(char c: s) freq[c - 'a'] ++;
int odd = 0;
for(int e: freq) if(e % 2) odd ++;
while(odd && k) k --, odd --;
return odd < 1;
}
};
int main() {
cout << Solution().canConstruct("annabelle", 2) << endl;
cout << Solution().canConstruct("leetcode", 3) << endl;
cout << Solution().canConstruct("abcdefghijklmnopqrstuvwxyz", 25) << endl;
return 0;
}