Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Words Found in Sentences

med
30 min
Try to solve the Maximum Number of Words Found in Sentences problem.

Statement

You are given an array of strings sentences, where each sentences[i] represents a single sentence.

Return the maximum number of words that appear in any single sentence.

A sentence is defined as a sequence of words separated by a single space with no leading or trailing spaces.

Constraints:

  • 1≤1 \leq sentences.length ≤100\leq 100

  • 1≤1 \leq sentences[i].length ≤100\leq 100

  • sentences[i] consists only of lowercase English letters and ' '.

  • sentences[i] does not have leading or trailing spaces.

  • All the words in sentences[i] are separated by a single space.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Words Found in Sentences

med
30 min
Try to solve the Maximum Number of Words Found in Sentences problem.

Statement

You are given an array of strings sentences, where each sentences[i] represents a single sentence.

Return the maximum number of words that appear in any single sentence.

A sentence is defined as a sequence of words separated by a single space with no leading or trailing spaces.

Constraints:

  • 1≤1 \leq sentences.length ≤100\leq 100

  • 1≤1 \leq sentences[i].length ≤100\leq 100

  • sentences[i] consists only of lowercase English letters and ' '.

  • sentences[i] does not have leading or trailing spaces.

  • All the words in sentences[i] are separated by a single space.