Eassyyy Pessyyy Solution ✅ | Runtime 91.82%🔥| TC = O(n) 🔥| SC = O(1) 🔥
IntuitionThe problem involves determining whether it's possible to construct k palindrome strings from the given string s. Palindromes have specific properties:
# Intuition
#### The problem involves determining whether it's possible to construct k palindrome strings from the given string s. Palindromes have specific properties:

* A string can be rearranged into a palindrome if at most one character has an odd frequency (for a single palindrome).
* For multiple palindromes, the total number of characters with odd frequencies must be less than or equal to the number of palindromes (k).

# Approach
1. Check the base cases:
    * If the length of s equals k, return true.
    * If the length of s is less than k, return false.
2. Count the frequency of each character in s using a hash map (unordered_map).
3. Count how many characters have an odd frequency.
4. If the number of characters with odd frequencies is greater than k, return false. Otherwise, return true.

# Complexity
### Time Complexity: `O(n)`
* Building the frequency map takes O(n), where n is the length of the string s.
* Iterating through the hash map to count odd frequencies takes O(m), where m is the number of unique characters in s.
* In the worst case, m=26 for lowercase English letters, making it O(1) effectively.
* Overall: O(n).

### Space Complexity: `O(1)`

* The hash map requires O(m) space, where 
m is the number of unique characters in s. 
* In the worst case, m=26 for lowercase English letters, making it O(1) effectively.
* Overall: O(1) additional space.

# Code
```cpp []
class Solution {
public:
    bool canConstruct(string s, int k) {
        if(s.size() == k) return true;
        if(s.size() < k) return false;
        unordered_map<int,int> hmap;
        int count = 0;
        for(int i = 0; i < s.size(); i++){
            hmap[s[i]]++;
        }
        for(auto it = hmap.begin(); it != hmap.end(); it++){
            if(it->second % 2 == 1) count++;
        }
        if(count > k) return false;
        return true;
    }
};
```
![Shinchan_upvote.jpg](https://assets.leetcode.com/users/images/49147aeb-4559-4500-87f1-73a885205e4a_1736568780.7833862.jpeg)


['Hash Table', 'String', 'Counting', 'C++']