Skip to content

Commit d46a20d

Browse files
authored
Create maximum-number-of-words-found-in-sentences.py
1 parent 1f23f1b commit d46a20d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Time: O(n)
2+
# Space: O(1)
3+
4+
class Solution(object):
5+
def mostWordsFound(self, sentences):
6+
"""
7+
:type sentences: List[str]
8+
:rtype: int
9+
"""
10+
return 1+max(s.count(' ') for s in sentences)

0 commit comments

Comments
 (0)