Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b83816d

Browse files
add 2114
1 parent 9ac886c commit b83816d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|-----|----------------|---------------|--------|-------------|-------------
11+
|2114|[Maximum Number of Words Found in Sentences](https://leetcode.com/problems/maximum-number-of-words-found-in-sentences/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2114.java) ||Easy||
1112
|2110|[Number of Smooth Descent Periods of a Stock](https://leetcode.com/problems/number-of-smooth-descent-periods-of-a-stock/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2110.java) ||Medium||
1213
|2109|[Adding Spaces to a String](https://leetcode.com/problems/adding-spaces-to-a-string/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2109.java) ||Medium||
1314
|2108|[Find First Palindromic String in the Array](https://leetcode.com/problems/find-first-palindromic-string-in-the-array/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2108.java) ||Easy||
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.fishercoder.solutions;
2+
3+
public class _2114 {
4+
public static class Solution1 {
5+
public int mostWordsFound(String[] sentences) {
6+
int max = 0;
7+
for (String sentence : sentences) {
8+
max = Math.max(max, sentence.split("\\ ").length);
9+
}
10+
return max;
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)