You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did not find a solution to problem number 1400 in the Python language - that's why I added a solution to this problem, in addition I updated the readme file.
The text was updated successfully, but these errors were encountered:
from collections import Counter
def can_construct_palindrome(s, k):
# Count the frequency of each character in the string
char_count = Counter(s)
# Count the number of characters with odd frequency
odd_count = sum(count % 2 for count in char_count.values())
# If k is greater than or equal to the number of odd-count characters,
# it's possible to construct k palindromic strings
return k >= odd_count and k <= len(s)
Greetings,
I did not find a solution to problem number 1400 in the Python language - that's why I added a solution to this problem, in addition I updated the readme file.
The text was updated successfully, but these errors were encountered: