Verification system getting annoying
package com.codegym.task.task19.task1922;
import java.util.*;
import java.io.*;
public class Solution {
public static List<String> words = new ArrayList<>();
static {
words.add("file");
words.add("view");
words.add("In");
}
public static void main(String[] args) throws IOException{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
BufferedReader fileReader = new BufferedReader(new FileReader(reader.readLine()));
reader.close();
int count = 0;
while(fileReader.ready()){
String data = fileReader.readLine();
String [] arr = data.split(" ");
ArrayList<String> list = new ArrayList<>(Arrays.asList(arr));
for(int i =0;i<list.size();i++){
for(int j =0;j<words.size();j++){
if(list.get(i).equals(words.get(j))){
count++;
}
}
}
if(count == 2){
System.out.println(data);
}
}
fileReader.close();
}
}