Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

n = int(input())
s = {}

for i in range(n):
  c = "{}".format(sorted(Counter(input()).most_common()))
  v = s.get(c, 0)
  s[c] = v + 1

result = 0

for v in s.values():
  result += v * (v-1) / 2

print(int(result))


Fixed submission:
n = int(input())
s = {}

for i in range(n):
  #c = "{}".format(sorted(Counter(input()).most_common()))
  c = "".join(sorted(input()))
  v = s.get(c, 0)
  s[c] = v + 1

result = 0

for v in s.values():
  result += v * (v-1) / 2

print(int(result))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

n = int(input())
s = []

for i in range(n):
  c = Counter(input())
  s.append(c)

result = 0

for i in range(n):
  for j in range(i+1, n):
    if s[i] == s[j]:
      result += 1

print(result)


Fixed submission:
n = int(input())
s = {}

for i in range(n):
  #c = "{}".format(sorted(Counter(input()).most_common()))
  c = "".join(sorted(input()))
  v = s.get(c, 0)
  s[c] = v + 1

result = 0

for v in s.values():
  result += v * (v-1) / 2

print(int(result))
Buggy python submission (verdict: Runtime Error):
n, k = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
 
INF = float("inf")
 
dp = [INF] * n
 
dp[0] = 0
 
for i in range(1, n):
  for j in range(1, k+1):
    if 0 <= (i-j):
      dp[i] = min(dp[i], dp[i-j] + abs(h[i] - h[i-j]))
 
print(dp[n-1])

Fixed submission:
n = int(input())
h = [int(hi) for hi in input().split()]

inf = float('inf')

dp = [inf] * n

dp[0] = 0

for i in range(n):
  dp[i] = min(dp[i], dp[i-1] + abs(h[i] - h[i-1]))
  dp[i] = min(dp[i], dp[i-2] + abs(h[i] - h[i-2]))

print(dp[-1])

Buggy python submission (verdict: Runtime Error):
def rec(i):

  if dp[i] < inf:
    return dp[i]

  if i == 0:
    return 0

  res = inf
  res = min(res, rec(i-1) + abs(h[i] - h[i-1]))
  if i > 1:
    res = min(res, rec(i-2) + abs(h[i] - h[i-2]))

  dp[i] = res

  return res


n = int(input())
h = [int(hi) for hi in input().split()]

inf = float('inf')

dp = [inf] * n

print(rec(n-1))

Fixed submission:
n = int(input())
h = [int(hi) for hi in input().split()]

inf = float('inf')

dp = [inf] * n

dp[0] = 0

for i in range(n):
  dp[i] = min(dp[i], dp[i-1] + abs(h[i] - h[i-1]))
  dp[i] = min(dp[i], dp[i-2] + abs(h[i] - h[i-2]))

print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
n, k = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]

INF = float("inf")

dp = [INF] * n

dp[0] = 0

for i in range(1, n):
  for j in range(1, k+1):
    if 0 <= (i-j):
      dp[i] = min(dp[i], dp[i-j] + abs(h[i] - h[i-j]))

print(dp[n-1])

Fixed submission:
n, k = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]

INF = float("inf")

dp = [INF] * n

dp[0] = 0

for i in range(1, n):
  for j in range(1, k+1):
    if 0 <= (i-j):
      dp[i] = min(dp[i], dp[i-j] + abs(h[i] - h[i-j]))

print(dp[n-1])
Buggy python submission (verdict: Runtime Error):
n = input()
a = [int(value) for value in input()]

def num_two(input_number):
  number = input_number
  count = 0
  while True:
    if number / 2 == 0:
      count += 1
      number = number / 2
    else:
      break
  return count

num_twos = [num_two(ai) for ai in a]
print(min(num_twos))

Fixed submission:
n = input()
a = [int(value) for value in input().split()]

def num_two(input_number):
  number = input_number
  count = 0
  while True:
    if number % 2 == 0:
      count += 1
      number = number / 2
    else:
      break
  return count

num_twos = [num_two(ai) for ai in a]
# print(num_twos)
print(min(num_twos))
Buggy python submission (verdict: Runtime Error):
l = list(int(input()) for i in range(5))
A=[]
sum1=0
sum2=0

for i in range(5):
    if l[i]%10 == 0:
        A.append(0)
    else:
        A.append(10-(l[i]%10))
    
if A[0]==A[1]==A[2]==A[3]==A[4]==0:
    print(sum1 = l[0]+l[1]+l[2]+l[3]+l[4])
else:
    for k in range(5):
        sum2 += l[k]+A[k]
    print(sum2-max(A))

Fixed submission:
l = list(int(input()) for i in range(5))
A=[]
sum=0

for i in range(5):
    if l[i]%10 == 0:
        A.append(0)
    else:
        A.append(10-(l[i]%10))
    
if A[0]==A[1]==A[2]==A[3]==A[4]==0:
    print(l[0]+l[1]+l[2]+l[3]+l[4])
else:
    for k in range(5):
        sum += l[k]+A[k]
    print(sum-max(A))
Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
l=[]
for i in range(1,max(A,B)):
    if (A%i + B%i) == 0:
        l.append(i)
    else:
        pass
if A == 1 & B == 1:
    print(1)
else:
    print(l[-K])

Fixed submission:
A,B,K = map(int,input().split())
l=[]
for i in range(1,min(A,B)+1):
    if (A%i + B%i) == 0:
        l.append(i)
    else:
        pass
print(l[-K])
Buggy python submission (verdict: Runtime Error):
y,m,d = list(input().split("/"))
s = y+m+d

if s <= 20190430:
    print("Heisei")
else:
    print("TBD")

Fixed submission:
y,m,d = list(input().split("/"))
s = int(y+m+d)

if s <= 20190430:
    print("Heisei")
else:
    print("TBD")
Buggy python submission (verdict: Runtime Error):
from itertools import combinations

N = int(input())
s = [sorted(input(i)) for i in range(N)]

c = len([i for i in combinations(s, 2) if i[0] == i[1]])
print(c)


Fixed submission:
A, B = [int(i) for i in input().split()]

print(max(A+B, A-B, A*B))
Buggy python submission (verdict: Runtime Error):
import numpy as np

N, K = map(int, input().split(" "))
a = list(map(int, input().split(" ")))
a.insert(0, 0)
a_sum = np.tile(np.cumsum(np.array(a, dtype=np.int64)), (N+1, 1))
print(np.count_nonzero(a_sum - a_sum.T >= K))


Fixed submission:
X, A = input().split(" ")
print(0 if X < A else 10)
Buggy python submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split(" "))
area = W * H / 2
isMultiple = 1 if W/2 == x and H/2 == y else 0

print(f"{area} {isMultiple}")


Fixed submission:
W, H, x, y = map(int, input().split(" "))
area = W * H / 2
isMultiple = 1 if W/2 == x and H/2 == y else 0

print("{area} {isMultiple}".format(area=area, isMultiple=isMultiple))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(n):
    s.append(sorted(input()))
res = 0
for index, j in enumerate(s):
    res += s[index + 1:].count(j)

print(res)


Fixed submission:
n = int(input())
dic = {}
res = 0
for i in range(n):
    s = ''.join(sorted(input()))
    if s in dic.keys():
        res += dic[s]
        dic[s] += 1
    else:
        dic[s] = 1
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(n):
    s.append(input())
res = 0
for index, j in enumerate(s):
    for k in s[index + 1:]:
        for l in j:
            k = k.replace(l, "", 1)
        if not k:
            res += 1

print(res)

Fixed submission:
n = int(input())
dic = {}
res = 0
for i in range(n):
    s = ''.join(sorted(input()))
    if s in dic.keys():
        res += dic[s]
        dic[s] += 1
    else:
        dic[s] = 1
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
import re

n = int(input())
s = []
for i in range(n):
    s.append(input())
res = 0
for index, j in enumerate(s):
    for k in s[index + 1:]:
        for l in j:
            k = re.sub(l, "", k)
        if not k:
            res += 1

print(res)


Fixed submission:
n = int(input())
dic = {}
res = 0
for i in range(n):
    s = ''.join(sorted(input()))
    if s in dic.keys():
        res += dic[s]
        dic[s] += 1
    else:
        dic[s] = 1
print(res)
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
print(max({a+b,a-b,a*b})

Fixed submission:
a, b = map(int, input().split())
print(max({a+b,a-b,a*b}))
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = list(map(int,input().split()))
d.sort()
ans = d[n/2] - d[(n/2)-1]
print(ans)

Fixed submission:
n = int(input())
d = list(map(int,input().split()))
d.sort()
ans = d[int(n/2)] - d[int(n/2)-1]
print(ans)
Buggy python submission (verdict: Runtime Error):
W,H,x,y = map(int, input().split())
out1 = W*H/2
out2 = 0
if (x,y) = (W/2,H/2):
  out2 = 1
print(out1, out2)

Fixed submission:
W,H,x,y = map(int, input().split())
out1 = W*H/2
out2 = 0
if (x,y) == (W/2,H/2):
  out2 = 1
print(out1, out2)
Buggy python submission (verdict: Runtime Error):
p,q,r = map(int, input().split())
print(min(p+q, q+r, r+s))

Fixed submission:
p,q,r = map(int, input().split())
ans = min(p+q, q+r, r+p)
print(ans)

Buggy python submission (verdict: Runtime Error):
p,q,r = map(int, input().split())
print(min(p+q,q+r,r+s))

Fixed submission:
p,q,r = map(int, input().split())
ans = min(p+q, q+r, r+p)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math

def routeCombCount(distance):
  comb_count = 1
  max_skippable_count = distance // 2

  if max_skippable_count == 0:
    return 1

  for skippable_count in range(1, max_skippable_count + 1):
    step_count = distance - skippable_count
    comb_count += combinations_count(step_count, skippable_count)

  return comb_count

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

(N, M) = map(int, input().split(' '))

count = 1
aim_stage = N
now_stage = 0
before_broken = -1
for i in range(M):
  broken = int(input())
  if broken == before_broken + 1:
    count = 0
    break

  aim_stage = broken - 1
  distance = aim_stage - now_stage

  count *= routeCombCount(distance)

  before_broken = broken
  now_stage = broken + 1

distance = N - now_stage
count *= routeCombCount(distance)

print(count % 1000000007)

Fixed submission:
N, M = map(int, input().split())

halls = {}
for i in range(M):
    index = int(input())
    halls[index] = True

dp = [1] * (N + 1)

for i in range(1, N + 1):
    if i in halls:
        dp[i] = 0
        continue
    if i == 1:
        continue
    dp[i] = dp[max(0, i - 1)] + dp[max(0, i - 2)]
    
print(dp[N] % 1000000007)

Buggy python submission (verdict: Runtime Error):
from scipy.special import comb

def routeCombCount(distance):
  comb_count = 1
  max_skippable_count = distance // 2

  if max_skippable_count == 0:
    return 1

  for skippable_count in range(1, max_skippable_count + 1):
    step_count = distance - skippable_count
    comb_count += comb(step_count, skippable_count, exact=True)

  return comb_count

(N, M) = map(int, input().split(' '))

count = 1
aim_stage = N
now_stage = 0
before_broken = -1
for i in range(M):
  broken = int(input())
  if broken == before_broken + 1:
    count = 0
    break

  aim_stage = broken - 1
  distance = aim_stage - now_stage

  count *= routeCombCount(distance)

  before_broken = broken
  now_stage = broken + 1

distance = N - now_stage
count *= routeCombCount(distance)

print(count % 1000000007)

Fixed submission:
N, M = map(int, input().split())

halls = {}
for i in range(M):
    index = int(input())
    halls[index] = True

dp = [1] * (N + 1)

for i in range(1, N + 1):
    if i in halls:
        dp[i] = 0
        continue
    if i == 1:
        continue
    dp[i] = dp[max(0, i - 1)] + dp[max(0, i - 2)]
    
print(dp[N] % 1000000007)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

count = 0
for i in range(K + 1):
  for j in range(K + 1):
    for k in range(K + 1):
      if i + j + k == S:
        count = count + 1

print(count)

Fixed submission:
K, S = map(int, input().split())

count = 0
for i in range(K + 1):
  for j in range(K + 1):
      if S - i - j <= K and 0 <= S - i -j:
        count = count + 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

count = 0
for i in range(K + 1):
  for j in range(K + 1):
    for k in range(K + 1):
      if i + j + k == S:
        count = count + 1

print(count)

Fixed submission:
K, S = map(int, input().split())

count = 0
for i in range(K + 1):
  for j in range(K + 1):
      if S - i - j <= K and 0 <= S - i -j:
        count = count + 1

print(count)
Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = [input() for i in range(L)]
print(*(sorted(S)), sep='')


Fixed submission:
n,l=map(int,input().split())
s=sorted([input() for i in range(n)])
print(*s,sep="")

Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = [input() for i in range(L)]
print(*S, sep='')

Fixed submission:
n,l=map(int,input().split())
s=sorted([input() for i in range(n)])
print(*s,sep="")
Buggy python submission (verdict: Runtime Error):
S=input()
l=len(S)
r=0
list5 = ['dream', 'erase']
list81 = ['dreamdre', 'dreamera', 'erasedre', 'eraseera']
list82 = ['dreamerd', 'dreamere']
list83 = ['eraserdr', 'eraserer']
if l<=4:
    print(NO)

while l>=5:
    if S[r:r+5] in list5:
        if r+5==l:
            print(YES)
            break
        elif r+5 == l-1:
            if S[r:r+6] == 'eraser':
                print(YES)
            else:
                print(NO)
            break
        elif r+5 == l-2:
             if S[r:r+7] == 'dreamer':
                 print(YES)
             else:
                 print(NO)
             break
        elif r+5 == l-3 or r+5 == l-4:
            print(NO)
            break
        else:
            if S[r:r+8] in list81:
                r=r+5
            elif S[r:r+8] in list82:
                r=r+7
            elif S[r:r+8] in list83:
                r=r+6
            else:
                print(NO)
                break
    else:
        print(NO)
        break

Fixed submission:
S=input()
l=len(S)
r=0
list5 = ['dream', 'erase']
list81 = ['dreamdre', 'dreamera', 'erasedre', 'eraseera']
list82 = ['dreamerd', 'dreamere']
list83 = ['eraserdr', 'eraserer']
if l<=4:
    print('NO')

while l>=5:
    if S[r:r+5] in list5:
        if r+5==l:
            print('YES')
            break
        elif r+5 == l-1:
            if S[r:r+6] == 'eraser':
                print('YES')
            else:
                print('NO')
            break
        elif r+5 == l-2:
             if S[r:r+7] == 'dreamer':
                 print('YES')
             else:
                 print('NO')
             break
        elif r+5 == l-3 or r+5 == l-4:
            print('NO')
            break
        else:
            if S[r:r+8] in list81:
                r=r+5
            elif S[r:r+8] in list82:
                r=r+7
            elif S[r:r+8] in list83:
                r=r+6
            else:
                print('NO')
                break
    else:
        print('NO')
        break
Buggy python submission (verdict: Runtime Error):
A, B, C= map(int, input().split())
if C < (A-B):
    print("0")
else  
    print(C-(A-B))

Fixed submission:
A, B, C= map(int, input().split())
if C < (A-B):
    print("0")
else:
    print(C-(A-B))
Buggy python submission (verdict: Runtime Error):
n = int(input())

if n <10:
    count += n
elif n <100:
    count += 9
elif n <1000:
    count += n-90
elif n < 1000:
    count += 909
elif n < 10000:
    count += n-9090
elif n < 100000:
    count += 90909
else:
    count += 90910

print(count)

Fixed submission:
n = int(input())

if n <10:
    count = n
elif n <100:
    count = 9
elif n <1000:
    count = n-90
elif n < 10000:
    count = 909
elif n < 100000:
    count = n-9090
else:
    count = 90909

print(count)
Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
if max(a)*2 >=　sum(a):
    print("Yes")
else:
    print("No")

Fixed submission:
n=input()
a=list(map(int, input().split()))
if max(a)*2 < sum(a):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
if max(a)*2 >=　sum(a):
  print("Yes")
else:
  print("No")

Fixed submission:
n=input()
a=list(map(int, input().split()))
if max(a)*2 < sum(a):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
if max(a) >=　sum(a) - max(a):
  print("Yes")
else:
  print("No")

Fixed submission:
n=input()
a=list(map(int, input().split()))
if max(a)*2 < sum(a):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n = input()
N = int(n)
a = [input() for i in range(N)]
a = int(a)
if max(a)　>=　sum(a) - max(a):
  print("Yes")
else:
  print("No")

Fixed submission:
n=input()
a=list(map(int, input().split()))
if max(a)*2 < sum(a):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = int([input() for i in range(N)])
if max(a)　>=　sum(a) - max(a):
  print("Yes")
else:
  print("No")

Fixed submission:
n=input()
a=list(map(int, input().split()))
if max(a)*2 < sum(a):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [input() for i in range(N)]
if max(a)　>=　sum(a) - max(a):
  print("Yes")
else:
  print("No")

Fixed submission:
n=input()
a=list(map(int, input().split()))
if max(a)*2 < sum(a):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = input()
a = [input() for i in range(N)]

if max(a)　>=　sum(a) - max(a):
  print("Yes")
else:
  print("No")

Fixed submission:
n=input()
a=list(map(int, input().split()))
if max(a)*2 < sum(a):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = input()
a = [input() for i in range(N)]

if max(a)　>　sum(a) - max(a):
  print("Yes")
else
  print("No")

Fixed submission:
n=input()
a=list(map(int, input().split()))
if max(a)*2 < sum(a):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = input()
a = [input() for i in range(N)]

if max(a)　>　sum(a) - max(a):
  print("Yes")
  else
      print("No")

Fixed submission:
n=input()
a=list(map(int, input().split()))
if max(a)*2 < sum(a):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = input()
a = [input() for i in range(N)]

if max(a)　>　sum(a) - max(a):
  print(Yes)
  else
      print(No)

Fixed submission:
n=input()
a=list(map(int, input().split()))
if max(a)*2 < sum(a):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h=[]
for i in range(n):
    tmp=int(input)
    c=t-tmp*0.006
    h.append(abs(a-c))

m=0
for i in range(1,n):
    if(h[i]<h[m]):
        m=i
print(m)


Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=[]
tmp=input()
lst=tmp.split(' ')

for i in range(n):
    c=t-int(lst[i])*0.006
    h.append(abs(a-c))

m=0
for i in range(1,n):
    if(h[i]<h[m]):
        m=i
print(m+1)

Buggy python submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h=[]
for i in rrange(n):
    tmp=int(input)
    c=t-tmp*0.006
    h.append(abs(a-c))

m=0
for i in range(1,n):
    if(h[i]<h[m]):
        m=i
print(m)


Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=[]
tmp=input()
lst=tmp.split(' ')

for i in range(n):
    c=t-int(lst[i])*0.006
    h.append(abs(a-c))

m=0
for i in range(1,n):
    if(h[i]<h[m]):
        m=i
print(m+1)
Buggy python submission (verdict: Runtime Error):
s=input()
if s=="1":
    print("Hello World")
else:
    a,b=map(int,input().split())
    print(a+b)


Fixed submission:
s=input()
if s=="1":
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)

Buggy python submission (verdict: Runtime Error):
s=input()
if s=="1":
    print("Hello World");
else:
    a,b=map(int,input().split())
    print(a+b)


Fixed submission:
s=input()
if s=="1":
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)
Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
    if b==0:
        return a
    else:
        gcd(b,a%b)


n,x=map(int,input().split())

if n==1:
    a=int(input())
    print(abs(a-x))
    exit()
else:
    str=input()
    lst=str.split(" ")
    a=int(lst[0])
    b=int(lst[1])
    maxim=gcd(abs(a-x),abs(b-x))
    for i in range(2,n):
        c=int(lst[i])
        maxim=gcd(maxim,abs(c-x))
print(maxim)


Fixed submission:
def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)


n,x=map(int,input().split())

if n==1:
    a=int(input())
    print(abs(a-x))
    exit()
else:
    str=input()
    lst=str.split(" ")
    a=int(lst[0])
    b=int(lst[1])
    maxim=gcd(abs(a-x),abs(b-x))
    for i in range(2,n):
        c=int(lst[i])
        maxim=gcd(maxim,abs(c-x))
print(maxim)
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
a=['']*h
for i in range(h):
    a[i]=input()

row=[False]*h
col=[False]*w

for i in range(h):
    for j in range(w):
        if a[i][j]=="#":
            raw[i]=True
            col[j]=True;

for i in range(h):
    if row[i]:
        for j in range(w):
            if col[j]:
                print(a[i][j],end="")
        print()


Fixed submission:
h,w=map(int,input().split())
a=['']*h
for i in range(h):
    a[i]=input()

row=[False]*h
col=[False]*w

for i in range(h):
    for j in range(w):
        if a[i][j]=="#":
            row[i]=True
            col[j]=True;

for i in range(h):
    if row[i]:
        for j in range(w):
            if col[j]:
                print(a[i][j],end="")
        print()

Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
a=['']*h
for i in range(h):
    a[i]=input()

row=[False]*h
col=[False]*w

for i in range(h):
    for j in range(w):
        if a[i][j]=="#":
            raw[i]=True
            col[j]=True;

for i in range(h):
    if raw[i]:
        for j in range(w):
            if col[j]:
                print(a[i][j],end="")
        print()


Fixed submission:
h,w=map(int,input().split())
a=['']*h
for i in range(h):
    a[i]=input()

row=[False]*h
col=[False]*w

for i in range(h):
    for j in range(w):
        if a[i][j]=="#":
            row[i]=True
            col[j]=True;

for i in range(h):
    if row[i]:
        for j in range(w):
            if col[j]:
                print(a[i][j],end="")
        print()

Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
a=['']*h
for i in range(h):
    a[i]=input()

row=[False]*h
col=[False]*w

for i in range(h):
    for j in range(w):
        if a[i][j]=="#":
            raw[i]=true
            col[j]=true;

for i in range(h):
    if raw[i]:
        for j in range(w):
            if col[j]:
                print(a[i][j],end="")
        print()


Fixed submission:
h,w=map(int,input().split())
a=['']*h
for i in range(h):
    a[i]=input()

row=[False]*h
col=[False]*w

for i in range(h):
    for j in range(w):
        if a[i][j]=="#":
            row[i]=True
            col[j]=True;

for i in range(h):
    if row[i]:
        for j in range(w):
            if col[j]:
                print(a[i][j],end="")
        print()
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
lst1=input()
lst2=lst1.split(" ")
lst=[]
for i in lst2:
    lst.append(int(i))

minr=[]
minl=[]

for i in range(n-k+1):
    l=i
    r=i+k-1
    minr.sppend(abs(lst[r])+abs(lst[r]-lst[l]))
    minl.append(abs(lst[l])+abs(lst[r]-lst[l]))

minr.sort()
minl.sort()

m=min(minr[0],minl[0])
print(m)

Fixed submission:
n,k=map(int,input().split())
lst1=input()
lst2=lst1.split(" ")
lst=[]
for i in lst2:
    lst.append(int(i))

minr=[]
minl=[]

for i in range(n-k+1):
    l=i
    r=i+k-1
    minr.append(abs(lst[r])+abs(lst[r]-lst[l]))
    minl.append(abs(lst[l])+abs(lst[r]-lst[l]))

minr.sort()
minl.sort()

m=min(minr[0],minl[0])
print(m)