qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x_max = max(x)
y_min = min(y)
if y_min - x_max >= 0:
    print("No War")
else:
    print("War")

Fixed code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x_max = max(x)
y_min = min(y)
if y_min - x_max > 0 and Y - x_max > 0 and y_min - X > 0:
    print("No War")
else:
    print("War")
Buggy code:
# coding: utf-8

n, m, x, y = map(int, input().split())
xn = list(map(int, input().split())
ym = list(map(int, input().split())

if x < y:
    if max(xn) < min(ym):
        print("War")
else:
    print("No War")

Fixed code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
xn.append(x)
ym.append(y)
flag = 0

if max(xn) < min(ym):
    print("No War")
else:
    print("War")
Buggy code:
N, M, X, Y = list(map(int, input().split()))

x = list(map(int, input().split()))
y = list(map(int, input().split()))

x.sort(reverse=True)
y.sort()

if x[0] < y[0]:
    print("No War")
else:
    print("War")


Fixed code:
N, M, X, Y = list(map(int, input().split()))

x = list(map(int, input().split()))
y = list(map(int, input().split()))

x.append(X)
y.append(Y)

x.sort(reverse=True)
y.sort()

if x[0] < y[0]:
    print("No War")
else:
    print("War")
Buggy code:
n, m, x, y = map(int, input().split())
xs = map(int, input().split())
ys = map(int, input().split())
if max([x] + list(xs)) < min([y] + list(ys)):
    print "No War"
else:
    print "War"

Fixed code:
n, m, x, y = map(int, input().split())
xs = map(int, input().split())
ys = map(int, input().split())
print("No War" if max([x] + list(xs)) < min([y] + list(ys)) else "War")
Buggy code:
N, M, X, Y = map(int, input().split())
list_x = [int(i) for i in input().split()]
list_y = [int(j) for j in input().split()]
if X >= Y:
    print("War")
else:
    if max(list_x) +1 >= min(list_y):
        print("War")
    else:
        print("No War")


Fixed code:
N, M, X, Y = map(int, input().split())
list_x = [int(i) for i in input().split()]
list_y = [int(j) for j in input().split()]
if max(list_x) >= min(list_y):
    print('War')
else:
    if X < max(list_x) + 1 <= Y:
        print('No War')
    else:
        print('War')
Buggy code:
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
maxX = max(x)
minY = min(y)
for i in range(X+1,Y,1):
  z = i
  if maxX < z and minY <= z:
    print('No War')
    exit()
print('War')

Fixed code:
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
maxX = max(x)
minY = min(y)
for i in range(X+1,Y,1):
  z = i
  if maxX < z and minY >= z:
    print('No War')
    exit()
print('War')
Buggy code:
N, M, X, Y =map( int, input()split())
x = list(map( int, input().split()))
y = list(map( int, input().split()))

x = sorted(x)
y = sorted(y)

for i in range(X + 1, Y + 1):
  if( x[N-1] < i <= y[0]):
    print('No War')
    exit()
    
  else:
    print('war')
    break

Fixed code:
N, M, X, Y =map( int, input().split())
x = list(map( int, input().split()))
y = list(map( int, input().split()))
 
x = sorted(x)
y = sorted(y)
 
for i in range(X + 1, Y + 1):
  if( x[N-1] < i <= y[0]):
    print('No War')
    exit()
    
print('War')
Buggy code:
n, m, x, y = [int(s) for s in input().split()]
lx = [int(s) for s in input().split()]
ly = [int(s) for s in input().split()]
mx = max(lx)
my = min(ly)
print("No War" if mx < my else "War")

Fixed code:
n, m, x, y = [int(s) for s in input().split()]
lx = [int(s) for s in input().split()]
ly = [int(s) for s in input().split()]
lx.append(x)
ly.append(y)
mx = max(lx)
my = min(ly)
print("No War" if mx < my else "War")
Buggy code:
n,m,a,b=map(int, input().split())
x=list(map(int, input().split()))
y=list(map(int, input().split()))
j=False
for i in range(a+1,b+1):
    if i<max(x) and min(y)>=i:
        j=True

print("No War" if j else "War")

Fixed code:
n,m,a,b=map(int, input().split())
x=list(map(int, input().split()))
y=list(map(int, input().split()))
j=False
for i in range(a+1,b+1):
    if max(x)<i and min(y)>=i:
        j=True

print("No War" if j else "War")
Buggy code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left

def main():
	N, M, X, Y = map(int, input().split(" "))
	X = input().split(" ")
	X = [int(s) for s in X]
	Y = input().split(" ")
	Y = [int(s) for s in Y]
	
	X.sort()
	Y.sort()
	
	if X >= Y:
		print("War")
		sys.exit()
	
	tmp = Y[0] - X[len(X)-1]
	if tmp < 2:
		print("War")
		sys.exit()
		
	for i in range(X[len(X)-1]+1, Y[0]):
		if i <= Y and X < i:
			print("No War")
			sys.exit()
	
	
	print("War")
		
	
if __name__ == "__main__":
	main()


Fixed code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left

def main():
	N, M, XX, YY = map(int, input().split(" "))
	X = input().split(" ")
	X = [int(s) for s in X]
	Y = input().split(" ")
	Y = [int(s) for s in Y]
	
	X.sort()
	Y.sort()
	
	if X >= Y:
		print("War")
		sys.exit()
	
	tmp = Y[0] - X[len(X)-1]
	if tmp < 1:
		print("War")
		sys.exit()
		
	for i in range(X[len(X)-1]+1, Y[0]+1):
		if i <= YY and XX < i:
			print("No War")
			sys.exit()
	
	print("War")
		
	
if __name__ == "__main__":
	main()
Buggy code:
N,M,X,Y=(int(i) for i in input().split())
xlist=[int(input()) for i in range(N)]
ylist=[int(input()) for i in range(M)]
xmax=max(xlist)
ymin=min(ylist)
if xmax<ymin:
  if xmax<Y and X<ymin:
    print('No War')
  else:
    print('War')
else:
  print('War')
    

Fixed code:
N,M,X,Y=(int(i) for i in input().split())
xlist=[int(i) for i in input().split()]
ylist=[int(i)for i in input().split()]
xmax=max(xlist)
ymin=min(ylist)
if xmax<ymin:
  if xmax<Y and X<ymin:
    print('No War')
  else:
    print('War')
else:
  print('War')
Buggy code:
from sys import stdin


n, m, x, y = [int(x) for x in stdin.readline().rstrip().split()]

xList = [int(x) for x in stdin.readline().rstrip().split()]
yList = [int(x) for x in stdin.readline().rstrip().split()]


isOk = True

xMax = max(xList)
yMin = min(yList)

ret = [int(z) for z in range(xMax+1, yMin+1) if (x < z) and (z <= y)]

if len(ret) > 0:
    print("War")
else:
    print("No War")

Fixed code:
from sys import stdin


n, m, x, y = [int(x) for x in stdin.readline().rstrip().split()]

xList = [int(x) for x in stdin.readline().rstrip().split()]
yList = [int(x) for x in stdin.readline().rstrip().split()]


isOk = True

xMax = max(xList)
yMin = min(yList)

ret = [int(z) for z in range(xMax+1, yMin+1) if (x < z) and (z <= y)]

if len(ret) > 0:
    print("No War")
else:
    print("War")
Buggy code:
N, M, X, Y = map(int, input().split(" "))
Xs = [int(a) for a in input().split()]
Ys = [int(a) for a in input().split()]
maxX = X
minY = Y
for i in Xs:
    if i>maxX:
        maxX = i

for i in Ys:
    if i<minY:
        min = i
        
if maxX < minY:
    print ("No War")
else:
    print ("War")


Fixed code:
N, M, X, Y = map(int, input().split(" "))
Xs = [int(a) for a in input().split()]
Ys = [int(a) for a in input().split()]
maxX = X
minY = Y
for i in Xs:
    if i>maxX:
        maxX = i

for i in Ys:
    if i<minY:
        minY = i
        
if maxX < minY:
    print ("No War")
else:
    print ("War")
Buggy code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, M, X, Y, x, y):
    mx = max(x)
    my = min(y)

    error_print(mx, my)
    if mx < my and (my >= X and mx < Y):
        return 'No War'
    return 'War'


def main():
    N, M, X, Y = read_int_n()
    x = read_int_n()
    y = read_int_n()
    print(slv(N, M, X, Y, x, y))


if __name__ == '__main__':
    main()


Fixed code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, M, X, Y, x, y):
    mx = max(x)
    my = min(y)

    error_print(mx, my)
    if mx < my and (my > X and mx < Y):
        return 'No War'
    return 'War'


def main():
    N, M, X, Y = read_int_n()
    x = read_int_n()
    y = read_int_n()
    print(slv(N, M, X, Y, x, y))


if __name__ == '__main__':
    main()
Buggy code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
if max(x)<min(y) and Y-X>1:
    print("No War")
else:
    print("War")

Fixed code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

x = max(x)
y = min(y)

if (x < y) and (X < y) and (Y >= y):
    print("No War")
else:
    print("War")
Buggy code:
n, m, x, y = map(int, input().split())
X = sorted(list(map(int, input().split())))
Y = sorted(list(map(int, input().split())))
if X[-1] < Y[0]:
  print("No War")
else:
  print("War")

Fixed code:
n, m, x, y = map(int, input().split())
X = sorted(list(map(int, input().split())) + [x])
Y = sorted(list(map(int, input().split())) + [y])

if X[-1] < Y[0]:
  print("No War")
else:
  print("War")
Buggy code:
N,M,X,Y = map(int,input().split())
A = list(map(int,input().split()))
A = sorted(A)
B = list(map(int,input().split()))
B = sorted(B)
if X<Y and A[-1]<B[0]:
    print("No War")
else:
    print("War")

Fixed code:
N,M,X,Y = map(int,input().split())
A = list(map(int,input().split()))
A = sorted(A)
B = list(map(int,input().split()))
B = sorted(B)
if X<Y and A[-1]<B[0]:
    if Y<=A[-1] or X>=B[0]:
        print("War")
    else:
        print("No War")
else:
    print("War")
Buggy code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
if max(x)<min(y):
    print('No War')
else:
    print('War')

Fixed code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
x.append(X)
y.append(Y)
if max(x)<min(y):
    print('No War')
else:
    print('War')
Buggy code:
n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
print("No War" if min(a)<=x<=max(a) and min(b)<=y<=max(b) and max(a) =<min(b) else "War")

Fixed code:
n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
a.append(x)
b=list(map(int,input().split()))
b.append(y)
print("No War" if max(a)<min(b) else "War")
Buggy code:
n,m,x,y=map(int,input().split())
a=map(int,input().split())
b=map(int,input().split())
A=max(a)
B=min(b)
D=0
for w in range(A+1,B+1):
 if x<w<=y:
  D+=1

if D>=1:
 print ("No war")
else:
 print("War")

Fixed code:
n,m,x,y=map(int,input().split())
a=map(int,input().split())
b=map(int,input().split())
A=max(a)
B=min(b)
D=0
for w in range(A+1,B+1):
 if x<w<=y:
  D+=1

if D>=1:
 print ("No War")
else:
 print("War")
Buggy code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x = max(x)
y = min(y)
if x < y:
  print("No War")
else:
  print("War")

Fixed code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x = max(X, max(x))
y = min(Y, min(y))
if x < y:
  print("No War")
else:
  print("War")
Buggy code:
N,M,X,Y=map(int,input().split())
x=list(int(i) for i in input().split())
y=list(int(i) for i in input().split())
if min(y)>max(x):
  if X<min(y):
    if y>max(x):
      print("No War")
    else:
      print("War")
  else:
    print("War")
else:
  print("War")

Fixed code:
N,M,X,Y=map(int,input().split())
x=list(int(i) for i in input().split())
y=list(int(i) for i in input().split())
if min(y)>max(x):
  if X<min(y):
    if Y>max(x):
      print("No War")
    else:
      print("War")
  else:
    print("War")
else:
  print("War")
Buggy code:
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.append(X)
y.append(y)

for i in range(len(x)):
	for j in range(i, len(x)):
		if (x[i] == x[j]) or (y[i] == y[j]):
			print('War')
			exit()

if max(x) >= min(y):
	print('War')
	exit()

print('No War')

Fixed code:

n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.append(X)
y.append(Y)

for i in range(len(x)):
	for j in range(len(y)):
		if (x[i] == y[j]):
			print('War')
			exit()

if max(x) >= min(y):
	print('War')
	exit()

print('No War')
Buggy code:
n, m, a, b = map(int, input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
x.sort()
y.sort()


if x[-1] < y[0]:
  for z in range(a, b + 1):
    if max(x) < z <= min(y):
      print("No War")
      exit()

print("War")

Fixed code:
n, m, a, b = map(int, input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
x.sort()
y.sort()



for z in range(a+1, b + 1):
  if max(x) < z <= min(y):
    print("No War")
    exit()

print("War")
Buggy code:
n,m,x,y = map(int,input().split())

lsx = list(map(int,input().split()))
lsy = list(map(int,input().split()))

if min(lsy) - max(lsx) > 0:
    print("War")
else:
    print("No war")


Fixed code:
n,m,x,y = map(int,input().split())

lsx = list(map(int,input().split()))
lsx.append(x)
lsy = list(map(int,input().split()))
lsy.append(y)

if min(lsy) - max(lsx) > 0:
    print("No War")
else:
    print("War")
Buggy code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
if X<Z<=Y and max(x)<Z and min(y)>=Z :
    print('No War')
else:
    print('War')

Fixed code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
Z=min(y)
if X<Z<=Y and max(x)<Z and min(y)>=Z :
    print('No War')
else:
    print('War')
Buggy code:
n, m, X, Y = map(int,input().split())
x = [int(x) for x in input().split()]
y = [int(x) for x in input().split()]
if X>= Y:
  print('War')
else:
  xmax = max(x)
  ymin = min(y)
  if xmax >= ymin:
    print('War')
  else:
    print('No War')

Fixed code:
n, m, X, Y = map(int,input().split())
x = [int(x) for x in input().split()]
y = [int(x) for x in input().split()]
if X>= Y:
  print('War')
else:
  xmax = max(x)
  ymin = min(y)
  if xmax >= ymin:
    print('War')
  elif xmax>=Y:
    print('War')
  elif X>= ymin:
    print('War')
  else:
    print('No War')
Buggy code:
import sys
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
for i in range(X+1,Y+1):
  if max(x)<i and min(y)>=i:
    print("No War")
    print(i)
    sys.exit()
print("War")

Fixed code:
import sys
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
for i in range(X+1,Y+1):
  if max(x)<i and min(y)>=i:
    print("No War")
    sys.exit()
print("War")
Buggy code:
n,m,x,y = map(int,input().split())
X = map(int,input().split())
Y = map(int,input().split())
if max(X)+1 <= min(Y) and max(X) > x and min(Y) <= y:
    print("No War")
else:
    print("War")

Fixed code:
n,m,x,y = map(int,input().split())
X = list(map(int,input().split()))
Y = list(map(int,input().split()))
if max(X)+1 <= min(Y) and max(X) > x and min(Y) <= y:
    print("No War")
else:
    print("War")
Buggy code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
if min(y)>max(x):
  print("No War")
else:
  print("War")

Fixed code:
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))

if max(x) < min(y) and (max(x) < Y and min(y) > X):
    print("No War")
else:
    print("War")
Buggy code:
NMXY = list(map(int, input().split()))
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))

if max(xlist) < min(ylist) and NMXY[2] < NMXY[3]:
    print('No War')
else:
    print('War')

Fixed code:
NMXY = list(map(int, input().split()))
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))

if max(xlist) < min(ylist) and NMXY[2] < NMXY[3] and max(xlist) < NMXY[3] and NMXY[2] < min(ylist):
    print('No War')
else:
    print('War')
Buggy code:
from collections import defaultdict

s=input()
t=input()
lis=defaultdict(lambda:-1)
lis2=defaultdict(lambda:-1)
for i,val in enumerate(s):
    if lis[i]==-1:
        lis[i]=val
    else:
        if lis[i]!=val:
            print("No")
            exit()
for i,val in enumerate(t):
    if lis2[i]==-1:
        lis2[i]=val
    else:
        if lis2[i]!=val:
            print("No")
            exit()
print("Yes")

Fixed code:
from collections import defaultdict

s=input()
t=input()
lis=defaultdict(lambda:"A")
lis2=defaultdict(lambda:"A")
for i,val in enumerate(s):
    if lis[val]=="A":
        lis[val]=t[i]
    else:
        if lis[val]!=t[i]:
            print("No")
            exit()
for i,val in enumerate(t):
    if lis2[val]=="A":
        lis2[val]=s[i]
    else:
        if lis2[val]!=s[i]:
            print("No")
            exit()
print("Yes")
Buggy code:
from collections import defaultdict
S, T = map(lambda x: x.strip(), open(0).read().split())

ds, dt = defaultdict(str), defaultdict(str)
ans = 'Yes'
for s, t in zip(S, T):
    if ds[s] or ds[s] == t:
        ds[s] = t
    else:
        ans = 'No'
        break
    if dt[t] or dt[t] == s:
        dt[t] = s
    else:
        ans = 'No'
        break
print(ans)

Fixed code:
from collections import defaultdict
S, T = map(lambda x: x.strip(), open(0).read().split())

ds, dt = defaultdict(str), defaultdict(str)
ans = 'Yes'
for s, t in zip(S, T):
    if not ds[s] or ds[s] == t:
        ds[s] = t
    else:
        ans = 'No'
        break
    if not dt[t] or dt[t] == s:
        dt[t] = s
    else:
        ans = 'No'
        break
print(ans)
Buggy code:
S = input().strip()
T = input().strip()

ds = {}
dt = {}
ans = 'Yes'
for s, t in zip(S, T):
    if s not in ds or ds[s] == t:
        ds[s] = t
    else:
        ans = 'No'
        break
    if t not in dt or dt[s] == s:
        dt[t] = s
    else:
        ans = 'No'
        break
print(ans)

Fixed code:
S = input().strip()
T = input().strip()

ds = {}
dt = {}
ans = 'Yes'
for s, t in zip(S, T):
    if s not in ds or ds[s] == t:
        ds[s] = t
    else:
        ans = 'No'
        break
    if t not in dt or dt[t] == s:
        dt[t] = s
    else:
        ans = 'No'
        break
print(ans)
Buggy code:
S = input()
T = input()
ans = "Yes"
start = [-1]*26
goal = [-1]*26
for i in range(len(S)):
    s,t = ord(S[i])-96,ord(T[i])-96
    if start[s]!=-1 or goal[t]!=-1:
        if start[s]!=t or goal[t]!=s:
            ans = "No"
    else:
        start[s] = t
        goal[t] = s
print(ans)

Fixed code:
S = input()
T = input()
ans = "Yes"
start = [-1]*27
goal = [-1]*27
for i in range(len(S)):
    s,t = ord(S[i])-96,ord(T[i])-96
    if start[s]!=-1 or goal[t]!=-1:
        if start[s]!=t or goal[t]!=s:
            ans = "No"
    else:
        start[s] = t
        goal[t] = s
print(ans)
Buggy code:
s=str(input())
t=str(input())
temp=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
s=list(set(s))
t=list(set(t))
temps=[0]*len(temp)
tempt=[0]*len(temp)
for i in range(0,len(temp)):
  temps[i]=s.count(temp[i])
  tempt[i]=t.count(temp[i])
if temps==tempt:
  print("Yes")
else:
  print("No")

Fixed code:
s=str(input())
t=str(input())
temp=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
s=list(s)
t=list(t)
temps=[0]*len(temp)
tempt=[0]*len(temp)
for i in range(0,len(temp)):
  temps[i]=s.count(temp[i])
  tempt[i]=t.count(temp[i])
temps.sort()
tempt.sort()
if temps==tempt:
  print("Yes")
else:
  print("No")
Buggy code:
import collections

s=list(input())
t=list(input())

ss=collections.Counter(s)
tt=collections.Counter(t)

s_v = ss.values().sorted()
t_v = tt.values().sorted()

if s_v == t_v:
    print("Yes")
else:
    print("No")


Fixed code:
import collections

s=list(input())
t=list(input())

ss=collections.Counter(s)
tt=collections.Counter(t)

s_v = sorted(ss.values())
t_v = sorted(tt.values())

if s_v == t_v:
    print("Yes")
else:
    print("No")
Buggy code:
s = input()
t = input()
d_s = dict()
d_t = dict()
for i in range(len(s)):
  if not s[i] in d:
    d_s[s[i]] = t[i]
  elif d_s[s[i]] != t[i]:
    print('No')
    exit()
  if not t[i] in d:
    d_t[t[i]] = s[i]
  elif d_t[t[i]] != s[i]:
    print('No')
    exit()
print('Yes')

Fixed code:
s = input()
t = input()
d_s = dict()
d_t = dict()
for i in range(len(s)):
  if not s[i] in d_s:
    d_s[s[i]] = t[i]
  elif d_s[s[i]] != t[i]:
    print('No')
    exit()
  if not t[i] in d_t:
    d_t[t[i]] = s[i]
  elif d_t[t[i]] != s[i]:
    print('No')
    exit()
print('Yes')
Buggy code:
import collections

s = input()
t = input()
c1 = collections.Counter(s)
c2 = collections.Counter(t)
s_values = sorted(list(c1.values()))
t_values = sorted(list(c2.values()))

if len(s) == len(t):
  if len(list(set(s))) == len(list(set(t))):
    if s_values == v_values():
      print("Yes")
    else:
      print("No")
  else:
    print("No")
else:
  print("No")

Fixed code:
import collections

s = input()
t = input()
c1 = collections.Counter(s)
c2 = collections.Counter(t)
s_values = sorted(list(c1.values()))
t_values = sorted(list(c2.values()))

if len(s) == len(t):
  if len(list(set(s))) == len(list(set(t))):
    if s_values == t_values:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
else:
  print("No")
Buggy code:
s = input()
t = input()
memo = {}
ans = 'Yes'
for i in range(len(s)):
    if s[i] in memo:
        if t[i] != memo[s[i]]:
            ans = 'No'
            break
    else:
        memo[s[i]] = t[i]
a = memo.values()
if set(a) != len(a):
    ans = 'No'
print(ans)

Fixed code:
s = input()
t = input()
memo = {}
ans = 'Yes'
for i in range(len(s)):
    if s[i] in memo:
        if t[i] != memo[s[i]]:
            ans = 'No'
            break
    else:
        memo[s[i]] = t[i]
a = list(memo.values())
b = list(set(a))
if len(b) != len(a):
    ans = 'No'
print(ans)
Buggy code:
from collections import defaultdict
s = input()
t = input()

st = defaultdict(lambda :0)
for x, y in zip(s,t):
    if st[y] != 0 and st[y] != x:
        print('No')
        exit()
    st[y] = x
    st[x] = y
print('Yes')

Fixed code:
from collections import defaultdict
s = input()
t = input()

st = defaultdict(lambda :0)
for x, y in zip(s,t):
    if (st[(y, 1)] != 0 and st[(y, 1)] != x) or (st[(x, 0)] != 0 and st[(x, 0)] != y):
        #print(x,y)
        print('No')
        exit()
    st[(y, 1)] = x
    st[(x, 0)] = y

print('Yes')