1from collections import Counter234class Solution:5 def canConstruct(self, s: str, k: int) -> bool:6 if k > len(s):7 return False8 h = Counter(s)9 countOdd = 010 for value in h.values():11 if value % 2:12 countOdd += 113 if countOdd > k:14 return False15 return True
WPM •0 •0
ACC •0 •0
TIME •0