Easy Approach
IntuitionTo construct k palindromes from the string s, we need:
At least k characters in the string. If s.size() < k, it is impossible, so return false.
Each pa
# Intuition
To construct k palindromes from the string s, we need:

1. At least k characters in the string. If s.size() < k, it is impossible, so return false.
2. Each palindrome can have at most one character with an odd frequency. Therefore, the total number of characters with odd frequencies in s must not exceed k.


# Approach
1. Check string size: If the length of s is less than k, return false since it's impossible to construct k palindromes.
2. Count character frequencies: Use an array freq to store the frequency of each character in s.
3. Count odd frequencies: Count how many characters have an odd frequency using the variable cnt.
4. Compare odd frequencies with k: If the number of odd frequencies (cnt) exceeds k, return false. Otherwise, return true.

# Complexity
- Time complexity:  O(n), where 𝑛 is the length of the string s. We iterate through the string once to count frequencies and through the array of size 26 to count odd frequencies.


- Space complexity: O(1), since the array freq has a fixed size of 26.

# Code
```cpp []
class Solution {
public:
    bool canConstruct(string s, int k) {
        if(s.size()<k) return false;
        int freq[26]={0};
        for(auto& i:s){
            freq[i-'a']++;
        }
        int cnt=0;
        for(int i=0;i<26;i++){
            if(freq[i]%2) cnt++;
        }
        if(cnt>k) return false;
        return true;
    }
};
```
['C++']