#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. currloc = [i_start,j_start] k = 0 ans = '' ans1 = [] k = 0 while currloc != [i_end,j_end] and k<2*n+1: k+=1 O = True if i_end currloc[1]: ans1.append('UR') currloc[0] -= 2 currloc[1] += 1 elif i_endcurrloc[0]+1 and j_end > currloc[1]: ans1.append('LR') currloc[0] += 2 currloc[1] += 1 elif i_end>currloc[0]+1 and j_end < currloc[1]: ans1.append('LL') currloc[0] += 2 currloc[1] -= 1 elif i_end>currloc[0]+3 and j_end == currloc[1]: tem = ((i_end - currloc[0])//4) currloc[0] += 4*tem for an in range(tem): ans1.append('LR') for an in range(tem): ans1.append('LL') elif j_end>currloc[1] +1: currloc[1] += 2 ans1.append('R') elif j_end