Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
s = input()
t = input()
count = 0
for i in range(26):
    start[i] = -1
    goal[i] = -1
for i in range(0,len(s)):
    a = s[i]
    b = t[i]
    if start[a] != -1 or goal[b] != -1:
        if start[a] != b or goal[b] != a:
            count = 1
            break
    else:
        start[a] = b
        goal[b] = a
if count == 1:
    print("No")
else:
    print("Yes")

s = input()
t = input()
count = 0
for i in range(26):
    start[i] = -1
    goal[i] = -1
for i in range(0,len(s)):
    a = s[i]-'a'
    b = t[i]-'a'
    if start[a] != -1 or goal[b] != -1:
        if start[a] != b or goal[b] != a:
            count = 1
            break
    else:
        start[a] = b
        goal[b] = a
if count == 1:
    print("No")
else:
    print("Yes")

s = input()
t = input()
start = [-1]*30
goal = [-1]*30
for i in range(0,len(s)):
    a = ord(s[i])-ord("a")
    b = ord(t[i])-ord("a")
    if start[a] != -1 or goal[b] != -1:
        if start[a] != b or goal[b] != a:
            count = 1
            break
    else:
        start[a] = b
        goal[b] = a
if count == 1:
    print("No")
else:
    print("Yes")

s = input()
t = input()
start = [-1]*26
goal = [-1]*26
for i in range(0,len(s)):
    a = ord(s[i])-ord("a")
    b = ord(t[i])-ord("a")
    if start[a] != -1 or goal[b] != -1:
        if start[a] != b or goal[b] != a:
            count = 1
            break
    else:
        start[a] = b
        goal[b] = a
if count == 1:
    print("No")
else:
    print("Yes")

s = input()
t = input()
count = 0
for i in range(26):
    start[i] = -1
    goal[i] = -1
for i in range(0,len(s)):
    a = oad(s[i])-oad("a")
    b = oad(t[i])-oad("a")
    if start[a] != -1 or goal[b] != -1:
        if start[a] != b or goal[b] != a:
            count = 1
            break
    else:
        start[a] = b
        goal[b] = a
if count == 1:
    print("No")
else:
    print("Yes")

s = input()
t = input()
count = 0
for i in range(oad('a'),oad('z')+1):
    start[i] = -1
    goal[i] = -1
for i in range(0,len(s)):
    a = s[i]
    b = t[i]
    if start[a] != -1 or goal[b] != -1:
        if start[a] != b or goal[b] != a:
            count = 1
            break
    else:
        start[a] = b
        goal[b] = a
if count == 1:
    print("No")
else:
    print("Yes")

s = list(str(input()))
t = list(str(input()))
count = 0
for i in range(26):
    start[i] = -1
    goal[i] = -1
for i in range(0,len(s)):
    a = s[i]-'a'
    b = t[i]-'a'
    if start[a] != -1 or goal[b] != -1:
        if start[a] != b or goal[b] != a:
            count = 1
            break
    else:
        start[a] = b
        goal[b] = a
if count == 1:
    print("No")
else:
    print("Yes")

s = input()
t = input()
start = [-1]*30
goal = [-1]*30
count = 0
for i in range(0,len(s)):
    a = ord(s[i])-ord("a")
    b = ord(t[i])-ord("a")
    if start[a] != -1 or goal[b] != -1:
        if start[a] != b or goal[b] != a:
            count = 1
            break
    else:
        start[a] = b
        goal[b] = a
if count == 1:
    print("No")
elif count == 0:
    print("Yes")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted