Code Coach It’s a sign
/*Java - Can this be optimised even further -*/ import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String entry[] = new String[4]; for (int i = 0; i < entry.length; i++) { entry[i] = scan.next().toUpperCase(); } String[] reversed = new String[4]; for (int i = 0; i < entry.length; i++) { char[] temp = entry[i].toCharArray(); char[] temp2 = new char[temp.length]; for (int j = 0; j < temp.length; j++) { temp2[(temp.length - 1) - j] = temp[j]; } reversed[i] = String.valueOf(temp2); } if (Arraycheck(entry, reversed)) { System.out.println("Open"); } else System.out.println("Trash"); } static Boolean Arraycheck(String[] original, String[] reversed) { for (int i = 0; i < original.length; i++) { for (int j = 0; j < reversed.length; j++) { if (original[i].equals(reversed[j])) { return true; } } } return false; } }