Maximum Number of Words Found in Sentences (Leetcode 2114)
Problem Link: https://leetcode.com/problems/maximum-number-of-words-found-in-sentences/
class Solution:
def mostWordsFound(self, sentences: List[str]) -> int:
ans=0
for i in sentences:
l=list(map(str,i.split(' ')))
ans=max(ans,len(l))
return ans
PreviousGoal Parser Interpretation (Leetcode 1678)NextMinimum Remove to Make Valid Parentheses (Leetcode 1249)
Last updated