Easy Solution | Frequency | Greedy | C++
IntuitionBy considering the properties of the palindrome, we could try to eliminate the cases that could not possibly lead to the solution.
An even length of th
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
By considering the properties of the palindrome, we could try to eliminate the cases that could not possibly lead to the solution.
1. An even length of the particular character do not cause the problem.
2. Odd length of character can only help to satisfy the condition if and only if they could be less than the value of k, as rest of the other even length characters could be distributed to attain the desired result.

# Approach
<!-- Describe your approach to solving the problem. -->
First check, if the length of the string is lesser than k, if so we cannot divide the string into k string, so return false.
Next check, if the length of the string is equal to k, if yes, then we return true, as it is always possible to have single length character which forms the palindrome.
Then use the map to keep the track of number ( frequency ) of character in the string.
Keep track of the number of odd length of character.
If there are more number of odd length of character then return false, else true.

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

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

# Code
```cpp []
class Solution {
public:
    bool canConstruct(string s, int k) {
        int n = s.size();
        if( n < k) return false;
        if( n == k) return true;

        unordered_map<char,int> mp;
        for(auto it: s) mp[it]++;

        int non_pairs = 0;
        for(auto it: mp){
            int num = it.second;
            non_pairs += (num%2);
        }
 
        if( non_pairs > k) return false;
        return true;
    }
};
```
['Hash Table', 'String', 'Greedy', 'Counting', 'C++']