Buggy python submission (verdict: Time Limit Exceeded):
s,t=input(),input()
n,m=len(s),len(t)
dp=[[0]*(m+1) for i in range(n+1)]
for i in range(n):
  for j in range(m):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i+1][j],dp[i][j+1])
ans=""
while m>0 and n>0:
  if s[n-1]==t[m-1]:ans+=s[n-1];n-=1;m-=1
  elif dp[n][m]==dp[n-1][m]:n-=1
  else:m-=1
print(ans[::-1])

Fixed submission:
s,t=input(),input()
n,m=len(s),len(t)
dp=[[0]*(m+1) for i in range(n+1)]
for i in range(n):
  for j in range(m):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i+1][j],dp[i][j+1])
ans=""
while m>0 and n>0:
  if s[n-1]==t[m-1]:ans=s[n-1]+ans;n-=1;m-=1
  elif dp[n][m]==dp[n-1][m]:n-=1
  else:m-=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s,t=[input() for i in (0,0)]
T,S=len(t),len(s)
dp=[["" for j in range(T+1)] for i in range(S+1)]
for i in range(S):
    for j in range(T):
        if s[i]==t[j]:dp[i+1][j+1]=dp[i][j]+s[i]
        else:dp[i+1][j+1]=max(dp[i][j],dp[i+1][j],dp[i][j+1],key=lambda x:len(x))
print(dp[S][T])

Fixed submission:
s,t=input(),input()
n,m=len(s),len(t)
dp=[[0]*(m+1) for i in range(n+1)]
for i in range(n):
  for j in range(m):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i+1][j],dp[i][j+1])
ans=""
while m>0 and n>0:
  if s[n-1]==t[m-1]:ans=s[n-1]+ans;n-=1;m-=1
  elif dp[n][m]==dp[n-1][m]:n-=1
  else:m-=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s,t=[input() for i in (0,0)]
T,S=len(t),len(s)
dp=[["" for j in range(T+1)] for i in range(S+1)]
for i in range(S):
    for j in range(T):
        if s[i]==t[j]:dp[i+1][j+1]=dp[i][j]+s[i]
        else:dp[i+1][j+1]=max(dp[i][j],dp[i+1][j],dp[i][j+1],key=lambda x:len(x))
print(dp[S][T])

Fixed submission:
s,t=input(),input()
n,m=len(s),len(t)
dp=[[0]*(m+1) for i in range(n+1)]
for i in range(n):
  for j in range(m):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i+1][j],dp[i][j+1])
ans=""
while m>0 and n>0:
  if s[n-1]==t[m-1]:ans=s[n-1]+ans;n-=1;m-=1
  elif dp[n][m]==dp[n-1][m]:n-=1
  else:m-=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s,t=[input() for u in (1,1)]
l,li=[['' for i in range(len(s)+1)] for j in (1,1)]
for j in range(len(t)):
  for i in range(len(s)):
    if t[j]==s[i]:
      l[i+1]=li[i]+t[j]
    else:l[i+1]=li[i+1] if len(li[i+1])>len(l[i]) else l[i]
    li=l
print(l[-1])

Fixed submission:
s,t=input(),input()
n,m=len(s),len(t)
dp=[[0]*(m+1) for i in range(n+1)]
for i in range(n):
  for j in range(m):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i+1][j],dp[i][j+1])
ans=""
while m>0 and n>0:
  if s[n-1]==t[m-1]:ans=s[n-1]+ans;n-=1;m-=1
  elif dp[n][m]==dp[n-1][m]:n-=1
  else:m-=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s,t=[tuple(input()) for u in (1,1)]
l,li=[['' for i in range(len(s)+1)] for j in (1,1)]
for j in range(len(t)):
  for i in range(len(s)):
    if t[j]==s[i]:
      l[i+1]=li[i]+t[j]
    else:l[i+1]=li[i+1] if len(li[i+1])>len(l[i]) else l[i]
    li=l
print(l[-1])

Fixed submission:
s,t=input(),input()
n,m=len(s),len(t)
dp=[[0]*(m+1) for i in range(n+1)]
for i in range(n):
  for j in range(m):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i+1][j],dp[i][j+1])
ans=""
while m>0 and n>0:
  if s[n-1]==t[m-1]:ans=s[n-1]+ans;n-=1;m-=1
  elif dp[n][m]==dp[n-1][m]:n-=1
  else:m-=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s,t=[tuple(input()) for u in (1,1)]
l=[['' for i in range(len(s)+1)] for j in range(len(t)+1)]
for j in range(len(t)):
  for i in range(len(s)):
    if t[j]==s[i]:
      l[j+1][i+1]=l[j][i]+t[j]
    else:l[j+1][i+1]=l[j][i+1] if len(l[j][i+1])>len(l[j+1][i]) else l[j+1][i]
print(l[len(t)][len(s)])

Fixed submission:
s,t=input(),input()
n,m=len(s),len(t)
dp=[[0]*(m+1) for i in range(n+1)]
for i in range(n):
  for j in range(m):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i+1][j],dp[i][j+1])
ans=""
while m>0 and n>0:
  if s[n-1]==t[m-1]:ans=s[n-1]+ans;n-=1;m-=1
  elif dp[n][m]==dp[n-1][m]:n-=1
  else:m-=1
print(ans)