标签:题目 图片 ons ret mic def bsp val collect
题目描述:
统计字符奇偶次数即可
class Solution: def canConstruct(self, s: str, k: int) -> bool: if k > len(s): return False c = collections.Counter(s) o = sum(i % 2 for i in c.values()) return o <= k
标签:题目 图片 ons ret mic def bsp val collect
原文地址:https://www.cnblogs.com/oldby/p/12636115.html