from typing import List


def _out_of_range(matrix: List[List[int]], row: int, col: int) -> bool:
    """Check if the row/col is out of range."""
    return row < 0 or col < 0 or row >= len(matrix) or col >= len(matrix[0])