[LeetCode] 2114. Maximum Number of Words Found in Sentences
Python
class Solution:
def mostWordsFound(self, sentences: List[str]) -> int:
answer = -sys.maxsize
for sentence in sentences:
temp = sentence.split()
answer = max(answer, len(temp))
return answer
댓글남기기