2219. Maximum Number of Words Found in Sentences
My accepted Python solution to LeetCode problem 2219, Maximum Number of Words Found in Sentences, running in 0ms.
- Difficulty: Easy
- Python
- Runtime 0ms
- Memory 12.5MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 0ms, memory 12.5MB, accepted 2025-12-24.
class Solution(object):
def mostWordsFound(self, sentences):
return max(sentence.count(' ') + 1 for sentence in sentences)