python用startswith方法一行结束,c++17还没有startswith方法。
def prefixCount(self, words: List[str], pref: str) -> int:
return len([x for x in words if x.startswith(pref)])
python用startswith方法一行结束,c++17还没有startswith方法。
def prefixCount(self, words: List[str], pref: str) -> int:
return len([x for x in words if x.startswith(pref)])