beats 100% || frequency array
IntuitionEach palindrmic string can have only one non pair element. So there must be max k elements with odd frequency in the given string.ApproachComplexity
Ti
# Intuition
Each palindrmic string can have only one non pair element. So there must be max k elements with odd frequency in the given string.
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

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

- Space complexity: O(1)  // array of size 26 is required
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

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