I have been asked to check the number of times a team\'s name is on the text that is on my computer. I wrote the code, the code works fine by counting the number of times th
In the method checkSeries1()
remove the method call for getName(teamName) out of for loop and call getName() only once outside for loop, like this:
int count = 0;
String name = getName(teamName);
for ( int index = 0 ; index < winners.length ; index ++ )
{
if ( name.equals(winners[index]))
{
count++;
}
}