#ERROR : cant find symbol

1 messages · Page 1 of 1 (latest)

viscid spruce
#

class Solution {
public int mostWordsFound(String[] s) {
List<Integer> al = new ArrayList<Integer>();
for(int i=0;i<s.length;i++);
{
String[] arr = s[i].split(" ");
al.add(arr.length);
}
Collections.sort(al);
Collections.reverse(al);
return al.get(0);
}
}
ERROR : Line 6: error: cannot find symbol
String[] arr = s[i].split(" ");
^
symbol: variable i
location: class Solution
s = ["alice and bob love icecream", "i think so too", "this is great thanks very much"]

toxic furnaceBOT
#

<@&987246399047479336> please have a look, thanks.

sturdy berry
#

remove the semicolon after your for

viscid spruce
#

yep got it thank you so much...though it was a silly thing....i wish i would have checked it twice before asking .....