Check if a Rook can reach the given destination in a single move | Function to check if it is possible to reach destination in a single move by a rook ; Given arrays
def check ( current_row , current_col , destination_row , destination_col ) : NEW_LINE INDENT if ( current_row == destination_row ) : NEW_LINE INDENT return ( " POSSIBLE " ) NEW_LINE DEDENT elif ( current_col == destination_col ) : NEW_LINE INDENT return ( " POSSIBLE " ) NEW_LINE DEDENT else : NEW_LINE INDENT return ( " NOT ▁ POSSIBLE " ) NEW_LINE DEDENT DEDENT current_row = 8 NEW_LINE current_col = 8 NEW_LINE destination_row = 8 NEW_LINE destination_col = 4 NEW_LINE output = check ( current_row , current_col , destination_row , destination_col ) NEW_LINE print ( output ) NEW_LINE