본문 바로가기
python-algorithm

leetcode 2114. Maximum Number of Words Found in Sentences

by 무적김두칠 2022. 3. 7.

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

 

반응형

댓글