由于z的特殊位置,右和下要放在后面,以防止出界
string alphabetBoardPath(string target) {
int r=0,c=0;
string res;
for(char ch:target){
int row = (ch-'a')/5,col=(ch-'a')%5;
while(c>col){
res+="L";
--c;
}
while(r>row){
res+="U";
--r;
}
while(r<row){
res+="D";
++r;
}
while(c<col){
res+="R";
++c;
}
res+="!";
}
return res;
}