Leetcode 434. Number of Segments in a String

class Solution(object):
    def countSegments(self, s):
        """
        :type s: str
        :rtype: int
        """
        return len(s.split())

 

posted @ 2019-03-21 07:59  周洋  阅读(146)  评论(0编辑  收藏  举报