import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { //UL, UR, R, LR, LL, L. static int[][] positions = new int[][]{{-2, -1}, {-2, 1}, {0, 2}, {2, 1}, {2, -1}, { 0, -2}}; static String[] moves = new String[]{"UL", "UR", "R", "LR", "LL", "L"}; static boolean[][] visited = null; static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { // Print the distance along with the sequence of moves. visited = new boolean[n][n]; Map parents = new HashMap<>(); int[][] dist = new int[n][n]; for(int[] d:dist) Arrays.fill(d, Integer.MAX_VALUE); int level = 0; if(i_start == i_end&& j_start== j_end) { System.out.println("0"); System.out.println(""); return; } visited[i_start][j_start] = true; Queue queue = new LinkedList<>(); queue.offer(new int[]{i_start, j_start}); while(!queue.isEmpty()){ int size = queue.size(); level++; for(int i = 0;i=0 && tempy>=0 && tempx