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"]
#ERROR : cant find symbol
1 messages · Page 1 of 1 (latest)