Maximum Number of Words Found in Sentences
给一个字符串组, 求words的个数最多的多少.
class Solution {
public int mostWordsFound(String[] sentences) {
int res = 0;
for(String s : sentences){
res = Math.max(res, s.split(" ").length);
}
return res;
}
}