C++ Check Odd Count
Intuition: a palindrome can have no more than one odd letter in the middle. If a string has n odd letters, we cannot construct less than n palindromes.\n\ncpp\n
Intuition: a palindrome can have no more than one odd letter in the middle. If a string has `n` odd letters, we cannot construct less than `n` palindromes.\n\n```cpp\nbool canConstruct(string s, int k) {\n    if (k >= s.size())\n        return k == s.size();\n    bool cnt[26] = {};\n    for (auto ch : s)\n        cnt[ch - \'a\'] = !cnt[ch - \'a\'];\n    auto odd = count_if(begin(cnt), end(cnt), [](int n) { return n % 2; });\n    return odd <= k;\n}\n```
[]