public static boolean allTheKnightsAreSafe(ArrayList<String> coordinateStrings,
ID: 3897113 • Letter: P
Question
public static boolean allTheKnightsAreSafe(ArrayList<String> coordinateStrings, int boardSize) Description: Given an ArrayList of coordinate strings representing the locations of the knights on a boardSize × boardSize chess board, return true if none of the knights can attack one another. Otherwise, return false.
Parameter Restrictions: boardSize will be a positive integer less than or equal to Integer.MAX_VALUE. boardSize describes both the length and width of the square board. (So, if boardSize = 8, then we have an 8 × 8 board.) coordinateStrings will be non-null, and any strings within that ArrayList will follow the format described above for valid coordinates on a boardSize × boardSize board. Each coordinate string in the ArrayList is guaranteed to be unique; the same coordinate string will never appear in the list more than once.
Output: This method should not print anything to the screen. Printing stray characters to the screen (including newline characters) is a leading cause of test case failure.