i looked through some of the hints and i cant figure it out!
package com.codegym.task.task07.task0708;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/*
Longest string
*/
public class Solution {
private static List<String> strings;
public static void main(String[] args) throws Exception {
//write your code here
strings = new ArrayList<>();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
for (int i = 0; i < 5; i++) {
strings.add(br.readLine());
}
int max = 0;
for (int i = 0 ; i < strings.size(); i++){
if (strings.get(i).length() > max) {
max = strings.get(i).length();
}
if (max == strings.get(i).length()) {
String s = strings.get(i);
System.out.println(s);
}
}
}
}