Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np

input = sys.stdin.readline

h, w = map(int, input().split())
map_arr1d = np.array([0 if s == '#' else 1 for _ in range(h) for s in input()[:-1]])
map_2d = map_arr1d.reshape(h, w)

h_map = []
for h_arr in map_2d:
    cnt = 0
    tmp_list = []
    for a in h_arr:
        if a == 0:
            if cnt > 0:
                tmp_list.extend([cnt]*cnt)
                cnt = 0
            tmp_list.append(0)
        else:
            cnt += 1
    if cnt > 0:
        tmp_list.extend([cnt]*cnt)
    h_map.extend(tmp_list)
h_map = np.array(h_map).reshape(h, w)

w_map = []
for w_arr in map_2d.T:
    cnt = 0
    tmp_list = []
    for a in w_arr:
        if a == 0:
            if cnt > 0:
                tmp_list.extend([cnt]*cnt)
                cnt = 0
            tmp_list.append(0)
        else:
            cnt += 1
    if cnt > 0:
        tmp_list.extend([cnt]*cnt)
    w_map.extend(tmp_list)
w_map = np.array(w_map).reshape(w, h).T
print((h_map + w_map).max()-1)


Fixed submission:
import sys

input = sys.stdin.readline

h, w = map(int, input().split())
map_list = [[0 if s == '#' else 1 for s in input()[:-1]] for _ in range(h)]

h_map = []
for h_list in map_list:
    cnt = 0
    tmp_list = []
    for a in h_list:
        if a == 0:
            if cnt > 0:
                tmp_list.extend([cnt]*cnt)
                cnt = 0
            tmp_list.append(0)
        else:
            cnt += 1
    if cnt > 0:
        tmp_list.extend([cnt]*cnt)
    h_map.append(tmp_list)

w_map = []
for w_arr in [list(x) for x in zip(*map_list)]:
    cnt = 0
    tmp_list = []
    for a in w_arr:
        if a == 0:
            if cnt > 0:
                tmp_list.extend([cnt]*cnt)
                cnt = 0
            tmp_list.append(0)
        else:
            cnt += 1
    if cnt > 0:
        tmp_list.extend([cnt]*cnt)
    w_map.append(tmp_list)
w_map = [list(x) for x in zip(*w_map)]
max_l = 0
for h_list, w_list in zip(h_map, w_map):
    for h_num, w_num in zip(h_list, w_list):
        max_l = max(max_l, h_num + w_num)
print(max_l - 1)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np

input = sys.stdin.readline

h, w = map(int, input().split())
map_arr1d = np.array([0 if s == '#' else 1 for _ in range(h) for s in input()[:-1]])
map_2d = map_arr1d.reshape(h, w)

h_map = []
for h_arr in map_2d:
    cnt = 0
    tmp_list = []
    for a in h_arr:
        if a == 0:
            if cnt > 0:
                tmp_list.extend([cnt]*cnt)
                cnt = 0
            tmp_list.append(0)
        else:
            cnt += 1
    if cnt > 0:
        tmp_list.extend([cnt]*cnt)
    h_map.extend(tmp_list)
h_map = np.array(h_map).reshape(h, w)

w_map = []
for w_arr in map_2d.T:
    cnt = 0
    tmp_list = []
    for a in w_arr:
        if a == 0:
            if cnt > 0:
                tmp_list.extend([cnt]*cnt)
                cnt = 0
            tmp_list.append(0)
        else:
            cnt += 1
    if cnt > 0:
        tmp_list.extend([cnt]*cnt)
    w_map.extend(tmp_list)
w_map = np.array(w_map).reshape(w, h).T
print((h_map + w_map).max()-1)


Fixed submission:
import sys

input = sys.stdin.readline

h, w = map(int, input().split())
map_list = [[0 if s == '#' else 1 for s in input()[:-1]] for _ in range(h)]

h_map = []
for h_list in map_list:
    cnt = 0
    tmp_list = []
    for a in h_list:
        if a == 0:
            if cnt > 0:
                tmp_list.extend([cnt]*cnt)
                cnt = 0
            tmp_list.append(0)
        else:
            cnt += 1
    if cnt > 0:
        tmp_list.extend([cnt]*cnt)
    h_map.append(tmp_list)

w_map = []
for w_arr in [list(x) for x in zip(*map_list)]:
    cnt = 0
    tmp_list = []
    for a in w_arr:
        if a == 0:
            if cnt > 0:
                tmp_list.extend([cnt]*cnt)
                cnt = 0
            tmp_list.append(0)
        else:
            cnt += 1
    if cnt > 0:
        tmp_list.extend([cnt]*cnt)
    w_map.append(tmp_list)
w_map = [list(x) for x in zip(*w_map)]
max_l = 0
for h_list, w_list in zip(h_map, w_map):
    for h_num, w_num in zip(h_list, w_list):
        max_l = max(max_l, h_num + w_num)
print(max_l - 1)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np

input = sys.stdin.readline

h, w = map(int, input().split())
map_arr1d = np.array([0 if s == '#' else 1 for _ in range(h) for s in input()[:-1]])
map_2d = map_arr1d.reshape(h, w)

h_map = []
for h_arr in map_2d:
    cnt = 0
    tmp_list = []
    for a in h_arr:
        if a == 0:
            if cnt > 0:
                tmp_list.extend([cnt]*cnt)
                cnt = 0
            tmp_list.append(0)
        else:
            cnt += 1
    if cnt > 0:
        tmp_list.extend([cnt]*cnt)
    h_map.extend(tmp_list)
h_map = np.array(h_map).reshape(h, w)

w_map = []
for w_arr in map_2d.T:
    cnt = 0
    tmp_list = []
    for a in w_arr:
        if a == 0:
            if cnt > 0:
                tmp_list.extend([cnt]*cnt)
                cnt = 0
            tmp_list.append(0)
        else:
            cnt += 1
    if cnt > 0:
        tmp_list.extend([cnt]*cnt)
    w_map.extend(tmp_list)
w_map = np.array(w_map).reshape(w, h).T
print(max((h_map + w_map).flatten())-1)


Fixed submission:
import sys

input = sys.stdin.readline

h, w = map(int, input().split())
map_list = [[0 if s == '#' else 1 for s in input()[:-1]] for _ in range(h)]

h_map = []
for h_list in map_list:
    cnt = 0
    tmp_list = []
    for a in h_list:
        if a == 0:
            if cnt > 0:
                tmp_list.extend([cnt]*cnt)
                cnt = 0
            tmp_list.append(0)
        else:
            cnt += 1
    if cnt > 0:
        tmp_list.extend([cnt]*cnt)
    h_map.append(tmp_list)

w_map = []
for w_arr in [list(x) for x in zip(*map_list)]:
    cnt = 0
    tmp_list = []
    for a in w_arr:
        if a == 0:
            if cnt > 0:
                tmp_list.extend([cnt]*cnt)
                cnt = 0
            tmp_list.append(0)
        else:
            cnt += 1
    if cnt > 0:
        tmp_list.extend([cnt]*cnt)
    w_map.append(tmp_list)
w_map = [list(x) for x in zip(*w_map)]
max_l = 0
for h_list, w_list in zip(h_map, w_map):
    for h_num, w_num in zip(h_list, w_list):
        max_l = max(max_l, h_num + w_num)
print(max_l - 1)