my works on my computer but here doesn't pass. any idea why?
package com.codegym.task.task08.task0829;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.Map.Entry;
/*
Software update
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
boolean loopAgain = true;
HashMap<String, String> myList = new HashMap<String, String>();
// loop while user not entering data
while (true) {
String city = reader.readLine();
if (city.isEmpty()) {
break;
}
String family = reader.readLine();
myList.put(city, family);
}
// value whose key is to be searched
String findFamily = reader.readLine();
// iterate each entry of hashmap
for(Entry<String, String> entry: myList.entrySet()) {
// if give value is equal to value from entry
// print the corresponding key
if(entry.getValue().equals(findFamily)) {
System.out.println(entry.getKey());
break;
}
}
}
}