def _neighbors(text: str, pos: list[int]) -> dict[str, str]:
    """Finds the characters neighboring a position

    Args:
        text (str): The text to use when finding neighbors
        pos (list[int]): The location in the form [row, column]

    Returns:
        dict[str, str]: A dictionary of neighbors of the form
            {"N": `chr`, "S": `chr`, "E": `chr`, "W": `chr`}.
            If there is no neighboring character in a cardinal direction,
            then that `chr` will be \0.
    """
    r, c = pos
    chars = [[*line] for line in text.splitlines()]
    near = {}

    find = {
        "E": lambda: chars[r][c + 1],
        "W": lambda: chars[r][c - 1],
        "S": lambda: chars[r + 1][c],
        "N": lambda: chars[r - 1][c],
    }

    for direction in find:
        try:
            near[direction] = find[direction]()
        except IndexError:
            near[direction] = "\0"

    return near