class Solution:
def mostWordsFound(self, sentences: List[str]) -> int:
maxi=0
for sentence in sentences:
count=0
for char in sentence:
if char==" ":
#use an space to separate different words
count+=1
#the number of spaces will always be one less than the total number of words
count+=1
if count>maxi:
maxi=count
return maxi
int mostWordsFound(char ** sentences, int sentencesSize){
int max=0;
for (int i=0;i<sentencesSize;i++)
{
int length=strlen(sentences[i]);
char* sentence=sentences[i];
int count=1;
for (int j=0;j<length;j++)
{
if (sentence[j]==32)
{
count+=1;
}
}
if (count>max)
{
max=count;
}
}
return max;
}