C# Solution for Construct K Palindrome Strings Problem
IntuitionThe problem involves determining whether all characters in a string s can be used to construct exactly k palindrome strings. The key observations are:
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
The problem involves determining whether all characters in a string s can be used to construct exactly k palindrome strings. The key observations are:
1.	Odd Frequency Characters: A palindrome can have at most one character with an odd frequency (for the middle position). If more than k characters have an odd frequency, it’s impossible to form k palindromes.
2.	String Length vs. k: If k > s.Length, constructing k palindromes is impossible, as we don’t have enough characters to distribute among k groups.

Given these observations:
•	The number of odd-frequency characters (oddCount) determines the minimum number of palindromes required.
•	If  k >= oddCount  and  k <= s.Length , the answer is true.

# Approach
<!-- Describe your approach to solving the problem. -->
1.	Check if k > s.Length:
	•	If k > s.Length, return false because it’s impossible to construct more palindromes than the number of characters available.
2.	Character Frequency Count:
	•	Use an array of size 26 to count the frequency of each character in the string s. The array index represents the character (a to z).
3.	Count Odd Frequencies:
	•	Traverse the frequency array and count how many characters have an odd frequency (oddCount).
4.	Check Conditions:
	•	If oddCount > k, return false because it’s impossible to distribute odd characters across k palindromes.
	•	Otherwise, return true.

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
1.	Frequency Count: Counting the frequency of characters takes  O(n) , where  n  is the length of the string s.
2.	Odd Frequency Count: Iterating through the fixed-size frequency array (size 26) takes  O(1) .

Total Time Complexity:  O(n) .

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
1.	Frequency Array: We use an array of size 26 to store character counts.

Total Space Complexity:  O(1)  (constant space).

# Code
```csharp []
public class Solution {
    public bool CanConstruct(string s, int k) {
        if (k > s.Length) {
            return false;
        }

        int[] charCount = new int[26];
        foreach (char c in s) {
            charCount[c - 'a']++;
        }

        int oddCount = 0;
        foreach (int count in charCount) {
            if (count % 2 != 0) {
                oddCount++;
            }
        }

        return oddCount <= k;
    }
}
```
['C#']