Assume array = [[A,B,C,D,E],[F,G,H,I,J],[K,L,M,N,O],[P,Q,R,S,T],[U,V,W,X,Y],[Z,”#”,””#,””#,”#”]];
given a string = "BALL"
direction we can travel = [U,D,R,L] // up , down , right , left
return a result string , with directions i.e start from A->B->A->L-L;
Starting point is 0,0 i.e A
output : "R!L!DDR!!"
Please suggest what can be the best approach