Saturday, November 4, 2017

434. Number of Segments in a String

class Solution:
    def countSegments(self, s):
        """
        :type s: str
        :rtype: int
        """
        new_list = []
        new_list = s.split()
        return len(new_list)

No comments:

Post a Comment