Hi,
Strange on my local pc is ok
but the Validation doesnt accept it.
What would be the problem?
package com.codegym.task.task07.task0718;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Checking the order
*/
public class Solution {
public static void main(String[] args) throws IOException {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> arrayList = new ArrayList<>();
for (int i = 0; i < 10; i++) {
arrayList.add(reader.readLine());
}
for (int i = 0; i < arrayList.size()-1; i++) {
int current = arrayList.get(i).length();
int next = arrayList.get(i+1).length();
if (current+1 != next && i == 0) {
System.out.println(i+1);
break;
}
if (current+1 == next) {
continue;
}
else {
System.out.println(i+1);
break;
}
}
}
}