链接
https://leetcode.cn/problems/number-of-segments-in-a-string/description/
分析
直接split就好了。。
代码
class Solution: def countSegments(self, s: str) -> int: return s.split().__len__()