I got the correct output but didn't meet the #3 and #4 task requirements.
import java.util.Scanner;
import java.util.Arrays;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
Scanner scanner = new Scanner(System.in);
String[] input = new String[10];
int[] num = new int[10];
for (int i = 0; i < input.length; i++){
input[i] = scanner.nextLine();
num[i] = input[i].length();
}
for (int j = 0; j < num.length; j++){
System.out.println(num[j]);
}
}
}