I have a question when executing following codes:
if(column!=n-1){
    if(returnValue[row][column+1] == 0) column++;
    else {
        row++;
        direction = "down";
    }
}
else {
    row++;
    direction = "down";
}
If you see the codes, I need to check whether the column is exceeding the boundary first and then do another checking, which have duplicated codes in the else section. Is there a better way to write this logic?
 
     
     
    