Buggy python submission (verdict: Time Limit Exceeded):
H,W=map(int, input().split())
S=[]
for h in range(H):
    s=list(input())
    S.append(s)
ans=0
for h in range(H):
    for w in range(W):
        if S[h][w]==".":
            count=1
            que=[(h,w,"l"),(h,w,"u"),(h,w,"r"),(h,w,"d")]
            while len(que)>0:
                t=que.pop(0)
                h2,w2,to=t
                if to=="l":
                    nh=h2
                    nw=w2-1
                elif to=="u":
                    nh=h2+1
                    nw=w2
                elif to=="r":
                    nh=h2
                    nw=w2+1
                else:
                    nh=h2-1
                    nw=w2
                if 0<=nh<H and 0<=nw<W:
                    if S[nh][nw]==".":
                        count+=1
                        que.append((nh,nw,to))
            ans=max(ans, count)
print(ans)


Fixed submission:
import numpy as np
H, W=map(int, input().split())
S=np.array([list(input()) for _ in range(H)])
S=np.where(S==".",1,0 )

left=np.zeros((H, W))
right=np.zeros((H, W))
top=np.zeros((H, W))
bottom=np.zeros((H, W))

for i in range(W):
  if i==0:
    left[:,i]=S[:,i]
    right[:,-i-1]=S[:,-i-1]
  else:
    left[:,i]=(left[:,i-1]+1)*S[:,i]
    right[:,-i-1]=(right[:,-i]+1)*S[:,-i-1]
    
for i in range(H):
  if i==0:
    top[i,:]=S[i,:]
    bottom[-1-i,:]=S[-i-1,:]
  else:
    top[i,:]=(top[i-1,:]+1)*S[i,:]
    bottom[-1-i,:]=(bottom[-i,:]+1)*S[-i-1,:]
    
ans=left+top+right+bottom-3
    

print(int(ans.max()))

Buggy python submission (verdict: Runtime Error):
import numpy as np
H, W=map(int, input().split())
S=np.array([list(input()) for _ in range(H)])
S=np.where(S==".",1,0 )

left=np.zeros((H, W))
right=np.zeros((H, W))
top=np.zeros((H, W))
bottom=np.zeros((H, W))

for i in range(W):
  if i==0:
    left[:,i]=S[:,i]
    right[:,-i-1]=S[:,-i-1]
  else:
    left[:,i]=(left[:,i-1]+1)*S[:,i]
    right[:,-i-1]=(right[-i]+1)*S[:,-i-1]
    
for i in range(H):
  if i==0:
    top[i,:]=S[i,:]
    bottom[-1-i,:]=S[-i-1,:]
  else:
    top[i,:]=(top[i-1,:]-S[i,:])
    bottom[-1-i,:]=(bottom[-i]+1)*S[-i-1,:]
    
ans=left+top+right+bottom-3
    
    
print(ans.max())

Fixed submission:
import numpy as np
H, W=map(int, input().split())
S=np.array([list(input()) for _ in range(H)])
S=np.where(S==".",1,0 )

left=np.zeros((H, W))
right=np.zeros((H, W))
top=np.zeros((H, W))
bottom=np.zeros((H, W))

for i in range(W):
  if i==0:
    left[:,i]=S[:,i]
    right[:,-i-1]=S[:,-i-1]
  else:
    left[:,i]=(left[:,i-1]+1)*S[:,i]
    right[:,-i-1]=(right[:,-i]+1)*S[:,-i-1]
    
for i in range(H):
  if i==0:
    top[i,:]=S[i,:]
    bottom[-1-i,:]=S[-i-1,:]
  else:
    top[i,:]=(top[i-1,:]+1)*S[i,:]
    bottom[-1-i,:]=(bottom[-i,:]+1)*S[-i-1,:]
    
ans=left+top+right+bottom-3
    

print(int(ans.max()))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
H, W=map(int, input().split())
S=np.array([list(input()) for _ in range(H)])
def calc(h,w):
  row=S[h,:]
  col=S[:,w]
  
  count_h=0
  include=False
  for i,r in enumerate(row):
    if i==w:
        include=True
    if r==".":
      count_h+=1
    else:
      if include:
        break
      count_h=0
      
  count_w=0
  include=False
  for i,c in enumerate(col):
    if i==h:
      include=True
    if c==".":
      count_w+=1
    else:
      if include:
        break
      count_w=0
  return count_h+count_w-1


ans=0        
for i in range(H):
  for j in range(W):
    if S[i,j]==".":
      ans=max(ans, calc(i, j))
    
print(ans)

Fixed submission:
import numpy as np
H, W=map(int, input().split())
S=np.array([list(input()) for _ in range(H)])
S=np.where(S==".",1,0 )

left=np.zeros((H, W))
right=np.zeros((H, W))
top=np.zeros((H, W))
bottom=np.zeros((H, W))

for i in range(W):
  if i==0:
    left[:,i]=S[:,i]
    right[:,-i-1]=S[:,-i-1]
  else:
    left[:,i]=(left[:,i-1]+1)*S[:,i]
    right[:,-i-1]=(right[:,-i]+1)*S[:,-i-1]
    
for i in range(H):
  if i==0:
    top[i,:]=S[i,:]
    bottom[-1-i,:]=S[-i-1,:]
  else:
    top[i,:]=(top[i-1,:]+1)*S[i,:]
    bottom[-1-i,:]=(bottom[-i,:]+1)*S[-i-1,:]
    
ans=left+top+right+bottom-3
    

print(int(ans.max()))