Solution without HashTable || java || C++
IntuitionTo form a single palindrome string, either
it should have a single odd character or
it should have all characters with even frequencies
To form k palin
# Intuition
To form a single palindrome string, either 
- it should have a single odd character or
- it should have all characters with even frequencies 

To form `k` palindromes, the total number of characters with odd frequencies should be at most `k`.
- Each palindrome can have one character with an odd frequency (which will be placed in the center).
- If there are more than `k` characters with odd frequencies, it would be impossible to distribute them such that each palindrome has at most one odd character in the center.
 
Example : annabelle and `k` =2
`anna` - it contains all characters with even frequencies
`blele` - it contains b with 1 occurance and rest all characters with even occurances
oddcount= 1`<`k
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
#### Base Case : 
If length of the string is less than `k` then it is impossible to construct `k` palindromes
- Initialise a integer array or a vector to store all the occurances of characters in a string.
- Start iterating in array `ch`.
- if `ch[i]` is is even increment evencount.
- if `ch[i]` is is odd increment oddcount.
- Return `true` if oddcount is less than or equal to `k`.
- else Return `false`.
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity: $$O(n)$$ to form an array
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: $$O(26)$$ or $$O(1)$$
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public boolean canConstruct(String s, int k) {
        if(s.length()<k)return false;
        int ch[]= new int[26];
        for(char c: s.toCharArray()){
            ch[c-'a']++;
        }
        int oddcount=0;
        for(int i:ch){
            if(i%2!=0)oddcount++;
        }
        if(oddcount<=k)return true;
        else return false;
    }
}
```
```cpp []
class Solution {
public:
    bool canConstruct(string s, int k) {
        if (s.size() < k)
            return false;
        vector<int> ch(26, 0);
        for (int i=0;i<s.size();i++) {
            ch[s[i]-'a']++;
        }
        int oddcount = 0;
        for (int& i : ch) {
            if (i % 2 != 0)
                oddcount++;
        }
        if (oddcount <= k)
            return true;
        else
            return false;
    }
};
```
['Counting', 'C++', 'Java']