Number of Segments in a String
Input:
"Hello, my name is John"
Output:
5题目大意:
解题思路:
class Solution(object):
def countSegments(self, s):
"""
:type s: str
:rtype: int
"""
return len(s.split())Last updated