python-algorithm

leetcode 2114. Maximum Number of Words Found in Sentences

무적김두칠 2022. 3. 7. 10:43

1
2
3
4
5
6
class Solution:
    def mostWordsFound(self, sentences: List[str]) -> int:
        start=0
        for i in sentences:
            start=max(start,i.count(' '))
        return start+1
cs

 

반응형