Maximum Number of Words Found in Sentences LeetCode solution in Python

1
class Solution:
2
def mostWordsFound(self, sentences: List[str]) -> int:
3
mx = 0
4
for i in sentences:
5
c = i.split()
6
if len(c) > mx:
7
mx = len(c)
8
return mx

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0