from typing import List


def sum_risk_in_map(contents: List[str]) -> int:
    """Sum the risk of low points in the elevation map.

    Risk is the elevation of a low point plus one.

    Args:
        contents (List[str]): the file contents

    Returns:
        int: sum of risk

    """
    risk = 0
    low_points = []
    elevation_map = [[int(n) for n in row] for row in contents]
    for n, line in enumerate(elevation_map):
        left = [line[i] > num for i, num in enumerate(line[1:])]
        left.insert(0, True)
        right = [line[i + 1] > num for i, num in enumerate(line[:-1])]
        right.append(True)
        if n == 0:
            bottom = [
                elevation_map[n + 1][i] > num for i, num in enumerate(line)
                ]
            low = [all(conditions) for conditions in zip(left, right, bottom)]
        elif n == (len(elevation_map) - 1):
            top = [
                elevation_map[n - 1][i] > num for i, num in enumerate(line)
                ]
            low = [all(conditions) for conditions in zip(left, right, top)]
        else:            
            top = [
                elevation_map[n - 1][i] > num for i, num in enumerate(line)
                ]            
            bottom = [
                elevation_map[n + 1][i] > num for i, num in enumerate(line)
                ]
            low = [
                all(conditions) for conditions in zip(left, right, top, bottom)
                ]

        low_points.append(low)

    for row, low_row in enumerate(low_points):
        if not any(low_row):
            continue
        risk += sum(
            [
                elevation_map[row][col] + 1
                for col, low in enumerate(low_row) if low
                ]
            )

    return risk