Buggy python submission (verdict: Time Limit Exceeded):
def D_Lamp():
    h, w = map(int, input().split())
    S = [[] for j in range(h)]
    L = [[0 for i in range(w)] for j in range(h)]
    R = [[0 for i in range(w)] for j in range(h)]
    U = [[0 for i in range(w)] for j in range(h)]
    D = [[0 for i in range(w)] for j in range(h)]
    for row in range(h):
        S[row] = input()
    for row in range(h):
        for col in range(w):
            if "#" == S[row][col]:
                L[row][col] = 0
            elif col == 0:
                L[row][col] = 1
            elif "." == S[row][col]:
                L[row][col] = L[row][col-1] + 1
    for row in range(h):
        for col in range(w):
            tmp = w-col-1
            if "#" == S[row][tmp]:
                R[row][tmp] = 0
            elif col == 0:
                R[row][tmp] = 1
            elif "." == S[row][tmp]:
                R[row][tmp] = R[row][tmp+1] + 1
    for col in range(w):
        for row in range(h):
            if "#" == S[row][col]:
                U[row][col] = 0
            elif row == 0:
                U[row][col] = 1
            elif "." == S[row][col]:
                U[row][col] = U[row-1][col] + 1
    for col in range(w):
        for row in range(h):
            tmp = h-row-1
            if "#" == S[tmp][col]:
                D[tmp][col] = 0
            elif row == 0:
                D[tmp][col] = 1
            elif "." == S[tmp][col]:
                D[tmp][col] = D[tmp+1][col] + 1
    
    num_max = 0
    for row in range(h):
        for col in range(w):
            s_num = L[row][col] + R[row][col] + U[row][col] + D[row][col] - 3
            num_max = max(num_max, s_num)
    print(num_max)

if __name__ == "__main__":
    D_Lamp()

Fixed submission:
def D_Lamp():
    import numpy as np
    # input & init
    h, w = map(int, input().split())
    S = np.array([list(input()) for _ in range(h)]) == "."
    L = np.zeros((h,w), dtype=int)
    R = np.zeros((h,w), dtype=int)
    U = np.zeros((h,w), dtype=int)
    D = np.zeros((h,w), dtype=int)
    # calc row
    for row in range(h):
        D[row] =(D[row - 1] + 1) * S[row]
        U[-row - 1] = (U[-row] + 1) * S[-row -1]
    # calc col
    for col in range(w):
        R[:, col] = (R[:, col - 1] + 1) * S[:, col]
        L[:, -col - 1] = (L[:, -col] + 1) * S[:, -col-1]
    num_max = 0
    print(np.max(L+R+U+D) - 3)

if __name__ == "__main__":
    D_Lamp()

Buggy python submission (verdict: Runtime Error):
def D_Lamp():
    h, w = map(int, input().split())
    S = [[0 for i in range(w)] for j in range(h)]
    for row in range(h):
        si = input()
        for col in range(w):
            if "." == si[col]:
                S[row][col] = 1
    S_row = calc_point_row(h,w,S)
    S_col = calc_point_col(h,w,S)
    # 
    num_max = 0
    for row in range(h):
        for col in range(w):
            s_num = S_row[row][col] + S_col[row][col] - 1
            num_max = max(num_max, s_num)
    print(num_max)
def calc_point_row(h,w,S):
    S_tmp = [[0 for i in range(w)] for j in range(h)]
    for row in range(h):
        sum_w = 0
        for col in range(w):
            if 1 == S[row][col]:
                sum_w += 1
            elif (sum_w == 0):
                S_tmp[row][col] = 0
            else:
                for x in range(sum_w):
                    S_tmp[row][col-x-1] = sum_w
                sum_w = 0
        if (sum_w == w):
            for x in range(sum_w):
                S_tmp[row][i] = sum_w
        elif (sum_w != 0):
            for x in range(sum_w):
                S_tmp[row][w-x-1] = sum_w
    return S_tmp
def calc_point_col(h,w,S):
    S_tmp = [[0 for i in range(w)] for j in range(h)]
    for col in range(w):
        sum_w = 0
        for row in range(h):
            if 1 == S[row][col]:
                sum_w += 1
            elif (sum_w == 0):
                S_tmp[row][col] = 0
            else:
                for x in range(sum_w):
                    S_tmp[row-x-1][col] = sum_w
                sum_w = 0
        if (sum_w == h):
            for x in range(sum_w):
                S_tmp[x][col] = sum_w
        elif (sum_w != 0):
            for x in range(sum_w):
                S_tmp[h-x-1][col] = sum_w
    return S_tmp

if __name__ == "__main__":
    D_Lamp()

Fixed submission:
def D_Lamp():
    import numpy as np
    # input & init
    h, w = map(int, input().split())
    S = np.array([list(input()) for _ in range(h)]) == "."
    L = np.zeros((h,w), dtype=int)
    R = np.zeros((h,w), dtype=int)
    U = np.zeros((h,w), dtype=int)
    D = np.zeros((h,w), dtype=int)
    # calc row
    for row in range(h):
        D[row] =(D[row - 1] + 1) * S[row]
        U[-row - 1] = (U[-row] + 1) * S[-row -1]
    # calc col
    for col in range(w):
        R[:, col] = (R[:, col - 1] + 1) * S[:, col]
        L[:, -col - 1] = (L[:, -col] + 1) * S[:, -col-1]
    num_max = 0
    print(np.max(L+R+U+D) - 3)

if __name__ == "__main__":
    D_Lamp()