Problem:


Score : 300 points

Problem Statement

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.

Constraints

1 \leq |S| \leq 2 \times 10^5

|S| = |T|

S and T consists of lowercase English letters.

Input

Input is given from Standard Input in the following format:

S
T

Output

If S and T can be made equal, print Yes; otherwise, print No.

Sample Input 1

azzel
apple

Sample Output 1

Yes

azzel can be changed to apple, as follows:

Choose e as c_1 and l as c_2. azzel becomes azzle.

Choose z as c_1 and p as c_2. azzle becomes apple.

Sample Input 2

chokudai
redcoder

Sample Output 2

No

No sequences of operation can change chokudai to redcoder.

Sample Input 3

abcdefghijklmnopqrstuvwxyz
ibyhqfrekavclxjstdwgpzmonu

Sample Output 3

Yes



Sample input:
azzel
apple


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
a="abcdefghijklmnopqrstuvwxyz"
s=input()
t=input()
d={}
for i in a:d[i]=""
for i in range(len(s)):
  if d[s[i]]=="":d[s[i]]=t[i]
  elif d[s[i]]!=t[i]:exit(print("No"))
  if d[t[i]]=="":d[t[i]]=s[i]
  elif d[t[i]]!=s[i]:exit(print("No"))
print("Yes")

Submission status: Wrong Answer

Solution code:
from collections import Counter
s = Counter(input())
t = Counter(input())

if len(s) != len(t):
    print("No")
    exit()
for x,y in zip(s.values(), t.values()):
    if x != y:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
letters=[]
count=[]
for i in range(len(s)):
  if s[i] in letters:
    count[letters.index(s[i])].append(i)
  else:
    count.append([i])
    letters.append(s[i])
failflag=0
for i in count:
  r=t[i[0]]
  for j in i:
    if t[j]!=r:
      failflag=1
letters=[]
count=[]
for i in range(len(s)):
  if t[i] in letters:
    count[letters.index(t[i])].append(i)
  else:
    count.append([i])
    letters.append(t[i])
failflag=0
for i in count:
  r=s[i[0]]
  for j in i:
    if s[j]!=r:
      failflag=1
if failflag==0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = input()
t = input()

d = dict()
f = True
for c1, c2 in zip(s, t):
    if c2 not in d:
        d[c2] = c1
    elif d[c2] != c1:
        f = False
        break
if f:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
a = ord("a")
alph = ["0"]*26
for i in range(len(s)):
    s_al = ord(s[i])-a #s[i]の文字
    t_al = ord(t[i])-a #t[i]の文字
    if alph[s_al] == "0" or (alph[s_al] == t[i] and alph[t_al]== s[i]):
        alph[s_al] = t[i]
        alph[t_al] = s[i]
        
    else:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
S = list(input())
T = list(input())

# 例abcdefg...のように文字列が1対1の矢印関係の場合は、
# どのような場合でも置き換えできる。問題は同じ文字が複数現れる場合

# S上に同じ文字sのある場所には
# T上にも同じ文字tがなくてはならない
# つまり、同じ値になっているインデックスの集合を取れば
# 全部同じになっているはず

# 文字種ごとにインデックスの集合を求める
indexS = {}
for i, s in enumerate(S):
    if s in indexS:
        indexS[s].append(i)
    else:
        indexS[s] = [i]
indexT = {}
for i, t in enumerate(T):
    if t in indexT:
        indexT[t].append(i)
    else:
        indexT[t] = [i]
# 先頭の文字から、インデックスの集合が等しいかチェック
for s, t in zip(S, T):
    i_s = indexS[s]
    i_t = indexT[t]
    if i_s != i_t:
        print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
S = list(input())
T = list(input())

charmap = {}
for s, t in zip(S, T):
    if t in charmap:
        charmap[t].add(s)
    else:
        charmap[t] = set(s)

# マッピングが1対1なら交換できる
result = True
for k, v in charmap.items():
    if len(v) > 1:
        result = False
        break

if result:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = list(input())
T = list(input())

charmap = {}
for s, t in zip(S, T):
    if t in charmap:
        if charmap[t] == s:
            continue
        print("No")
        break
    else:
        charmap[t] = s
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
def count(l):
    res = {}
    for d in l:
        if d in res:
            res[d] += 1
        else:
            res[d] = 1
    return res
a = input()
b = input()
n = len(a)
a_ct = count(a)
b_ct = count(b)
a_match = {}
b_match = {}
a_num = {}
b_num = {}
for ca, cb in zip(a, b):
    if ca != cb:
        if ca not in a_match:
            a_match[ca] = cb 
            a_num[ca] = 1
        elif a_match[ca] != cb:
            print('No')
            exit()
        else:
            a_num[ca] += 1
        
        if cb not in b_match:
            b_match[cb] = ca 
            b_num[cb] = 1
        elif b_match[cb] != ca:
            print('No')
            exit()
        else:
            b_num[cb] += 1

for k, v in a_num.items():
    if v < a_ct[k]:
        print(-1)
        exit()
    
for k, v in b_num.items():
    if v < b_ct[k]:
        print(-1)
        exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
def count(l):
    res = {}
    for d in l:
        if d in res:
            res[d] += 1
        else:
            res[d] = 1
    return res
a = input()
b = input()
ac = count(a)
bc = count(b)
num_um = {}
um_pair = {}
for ca, cb in zip(a,b):
    if ca != cb:
        if ca in num_um:
            num_um[ca] += 1
        else:
            num_um[ca] = 1
        if ca in um_pair and um_pair[ca] != cb:
            print('No')
            exit()
        elif ca not in um_pair:
            um_pair[ca] = cb

for k, v in num_um.items():
    pair = um_pair[k]
    if v < ac[k]:
        print('No')
        exit()    
    if pair in ac:
        if pair not in um_pair or num_um[pair] != v:
            print('No')
            exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
a = input()
b = input()
dic = {}

for i in range(len(a)):
  if not b[i] in dic:
    dic[b[i]] = a[i]
  else:
    if dic[b[i]] != a[i]:
      print("No")
      quit()
  #print(dic)
print("Yes")

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
s=sorted(s)
t=sorted(t)
if (s==t):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

S = input()
T = input()

S_dic = defaultdict(list)
T_dic = defaultdict(list)

for i in range(len(S)):
	S_dic[S[i]].append(i)
	T_dic[T[i]].append(i)

if list(S_dic.values()) == list(T_dic.values()):
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

S = input()
T = input()

S_dic = defaultdict(list)
T_dic = defaultdict(list)

for i in range(len(S)):
	S_dic[S[i]].append(i)
	T_dic[T[i]].append(i)


if list(S_dic.values()) == list(T_dic.values()):
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
from collections import Counter

s = input()
t = input()

c1 = Counter(s).most_common()
c2 = Counter(t).most_common()

for x, y in zip(c1, c2):
    print(x, y)
    if x[1] != y[1]:
        print("No")
        break
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

s = list(map(str, input().rstrip()))
t = list(map(str, input().rstrip()))

d = defaultdict(set)

for x, y in zip(s, t):
    d[y].add(x)

print("Yes" if all([len(x) == 1 for x in list(d.values())]) else "No")

Submission status: Wrong Answer

Solution code:
import sys
from collections import defaultdict

s = list(map(str, input().rstrip()))
t = list(map(str, input().rstrip()))

d = defaultdict(str)

for x, y in zip(s, t):
    if d[y] == "" or d[y] == x:
        d[y] = x
    else:
        print("No")
        sys.exit()

else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
S=list(input())
T=list(input())
slist=[None]*26
flag=True
for i in range(len(S)):
    if T[i] in slist and slist[ord(S[i])-97] != T[i]:
        flag = False
        break
    else:
        slist[ord(S[i])-97] = T[i]
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=list(input())
T=list(input())
slist=[None]*26
flag=True
for i in range(len(S)):
    if T[i] not in slist or slist[ord(S[i])-97] == T[i]:
        slist[ord(S[i])-97] = T[i]
    else:
        flag = False
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=list(input())
T=list(input())
sdict={}
tdict={}
for i in S:
    if i not in sdict:
        sdict[i] = 1
    sdict[i] += 1
for i in T:
    if i not in tdict:
        tdict[i] = 1
    tdict[i] += 1
    
if list(sdict.values()).sort()==list(tdict.values()).sort():
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def examA():
    A = LI()
    A.sort()
    ans = A[2]*10+A[1]+A[0]
    print(ans)
    return

def examB():
    N, M, x, y = LI()
    X = LI()
    Y = LI()
    X.sort(); Y.sort()
    if max(X[-1],x)<min(Y[0],y):
        print("No War")
    else:
        print("War")
    return

def examC():
    S = SI()
    T = SI()
    N = len(S)
    Ds = defaultdict(str)
    Dt = defaultdict(str)
    for i in range(N):
        s = S[i]; t = T[i]
        if Ds[s]!="" and Ds[s]!=t:
            print("No")
            return
        Ds[s] = t
        if Dt[t] != "" and Dt[t] != s:
            print("No")
            return
        Dt[s] = s
    print("Yes")
    return

def examD():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examC()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Submission status: Wrong Answer

Solution code:
def examA():
    A = LI()
    A.sort()
    ans = A[2]*10+A[1]+A[0]
    print(ans)
    return

def examB():
    N, M, x, y = LI()
    X = LI()
    Y = LI()
    X.sort(); Y.sort()
    if max(X[-1],x)<min(Y[0],y):
        print("No War")
    else:
        print("War")
    return

def examC():
    S = SI()
    T = SI()
    N = len(S)
    D = defaultdict(str)
    for i in range(N):
        s = S[i]; t = T[i]
        if D[s]!="" and D[s]!=t:
            print("No")
            return
        D[s] = t
    print("Yes")
    return

def examD():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examC()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Submission status: Wrong Answer

Solution code:
def examA():
    A = LI()
    A.sort()
    ans = A[2]*10+A[1]+A[0]
    print(ans)
    return

def examB():
    N, M, x, y = LI()
    X = LI()
    Y = LI()
    X.sort(); Y.sort()
    if max(X[-1],x)<min(Y[0],y):
        print("No War")
    else:
        print("War")
    return

def examC():
    S = SI()
    T = SI()
    N = len(S)
    D = defaultdict(str)
    for i in range(N):
        s = S[i]; t = T[i]
        if D[t]!="" and D[t]!=s:
            print("No")
            return
        D[t] = s
    print("Yes")
    return

def examD():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examC()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Submission status: Wrong Answer

Solution code:
import sys
from collections import defaultdict
def input(): return sys.stdin.readline().strip()


def main():
    S = input()
    T = input()
    d = defaultdict(list)
    for i, s in enumerate(S):
        d[s].append(i)
    change_list = [i for i in range(26)]

    for i, s in enumerate(S):
        s = chr(97 + change_list[ord(s) - 97])
        t = T[i]
        if s != t and d[t] and d[t][0] < i:
            print("No")
            return
        elif s != t:
            d[s], d[t] = d[t], d[s]
            for i, w in enumerate(change_list):
                if w == ord(s) - 97:
                    change_list[i] = ord(t) - 97
                if w == ord(t) - 97:
                    change_list[i] = ord(s) - 97
    print("Yes")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
from collections import defaultdict
def input(): return sys.stdin.readline().strip()


def main():
    S = input()
    T = input()
    d = defaultdict(list)
    for i, s in enumerate(S):
        d[s].append(i)
    change_list = [i for i in range(26)]

    for i, s in enumerate(S):
        s = chr(97 + change_list[ord(s) - 97])
        t = T[i]
        if s != t and d[t] and d[t][-1] < i:
            print("No")
            return
        elif s != t:
            d[s], d[t] = d[t], d[s]
            for i, w in enumerate(change_list):
                if w == ord(s) - 97:
                    change_list[i] = ord(t) - 97
                if w == ord(t) - 97:
                    change_list[i] = ord(s) - 97
    print("Yes")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
S = set(input())
T = set(input())
if len(S)==len(T):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = set(input())
T = set(input())
if S==T:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
d = {}
for i in range(len(s)):
  if t[i] in d:
    if d[t[i]] != s[i]:
      print("No")
      break
  else:
    d[t[i]] = s[i]
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
d = {}
for i in range(len(s)):
  if s[i] in d:
    if d[s[i]] != t[i]:
      print("No")
      break
  else:
    d[s[i]] = t[i]
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
d = {}
for i in range(len(s)):
  if t[i] in d:
    if d[t[i]] != s[i]:
      print("No")
      break
  else:
    d[t[i]] = s[i]
print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
d = {}
for i in range(len(s)):
  if s[i] in d:
    if d[s[i]] != t[i]:
      print("No")
      break
  else:
    d[s[i]] = t[i]
print("Yes")

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
n=len(s)
for i in range(n-1):
  for j in range(i+1,n):
    if s[i]!=s[j] and t[i]==t[j]:
      print('No')
      exit()
    elif s[i]==t[j] and t[i]!=t[j]:
      print('No')
      exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
if len(set(s))!=len(set(t)):
  print('No')
  exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
S=input()
T=input()

alp={"a":0,"b":0,"c":0,"d":0,"e":0,"f":0,"g":0,"h":0,"i":0,"j":0,"k":0,"l":0,"m":0,"n":0,"o":0,"p":0,"q":0,"r":0,"s":0,"t":0,"u":0,"v":0,"w":0,"x":0,"y":0,"z":0}
bet={"a":0,"b":0,"c":0,"d":0,"e":0,"f":0,"g":0,"h":0,"i":0,"j":0,"k":0,"l":0,"m":0,"n":0,"o":0,"p":0,"q":0,"r":0,"s":0,"t":0,"u":0,"v":0,"w":0,"x":0,"y":0,"z":0}

for i in range(len(S)):
    alp[S[i]]=1
    bet[T[i]]=1
a=list(alp.values())
b=list(bet.values())
a.sort()
b.sort()
if a==b:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()
T=input()

alp={"a":0,"b":0,"c":0,"d":0,"e":0,"f":0,"g":0,"h":0,"i":0,"j":0,"k":0,"l":0,"m":0,"n":0,"o":0,"p":0,"q":0,"r":0,"s":0,"t":0,"u":0,"v":0,"w":0,"x":0,"y":0,"z":0}
bet={"a":0,"b":0,"c":0,"d":0,"e":0,"f":0,"g":0,"h":0,"i":0,"j":0,"k":0,"l":0,"m":0,"n":0,"o":0,"p":0,"q":0,"r":0,"s":0,"t":0,"u":0,"v":0,"w":0,"x":0,"y":0,"z":0}

for i in range(len(S)):
    alp[S[i]]=1
    bet[T[i]]=1
if sum(alp.values())==sum(bet.values()):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import collections


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

counts_s = collections.Counter(s)
counts_t = collections.Counter(t)


value_s = list(counts_s.values())
value_t = list(counts_t.values())


if value_s == value_t:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
data1 = {}
data2 = {}
for i in range(len(t)):
    if not t[i] in data1:
        data1[t[i]] = [s[i]]
    else:
        data1[t[i]].append(s[i])
for j in range(len(s)):
    if not s[i] in data2:
        data2[s[i]] = [t[i]]
    else:
        data2[s[i]].append(t[i])
for i in data1.values():
    if len(set(i)) != 1:
        print("No")
        break
else:
    for j in data2.values():
        if len(set(j)) != 1:
            print("No")
            break
    else:
        print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
data = {}
fix = []
for i in range(len(s)):
    if t[i] == s[i]:
        fix.append(t[i])
        continue
    if not t[i] in data:
        data[t[i]] = [s[i]]
    else:
        data[t[i]].append(s[i])
for i,j in data.items():
    if i in fix:
        print("No")
        break
    if len(set(j)) != 1:
        print("No")
        break
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()

l = len(s)
d = dict()

for i in range(l):
    if s[i] not in d:
        d[s[i]] = t[i]
    elif d[s[i]] != t[i]:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()

go = []
back = []
g = []
b = []
def has_duplicates(seq):
    return len(seq) != len(set(seq))


for i in range(len(s)):
  go.append(s[i]+t[i])
  back.append(t[i]+s[i])

go_l = set(go)
back_l = set(back)
go = list(go_l)
back = list(back_l)

print(go)
print(back)

for i in range(len(go)):
  g.append(go[i][0])
  b.append(back[i][0])
  
print(g)
print(b)
  
ansg = has_duplicates(g)
ansb = has_duplicates(b)

if ansg == True or ansb == True:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()

go = []
back = []
def has_duplicates(seq):
    return len(seq) != len(set(seq))


for i in range(len(s)):
  go.append(s[i])
  back.append(t[i])
  
ansg = has_duplicates(go)
ansb = has_duplicates(back)

if ansg == True or ansb == True:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
s=input()
t=input()

t1=sorted(t)
moji=[]
n=0
for i in range(len(t1)-1):
    if t1[i] == t1[i+1]:
        moji.append(t1[i])
        break


moji2='A'
for j in range(len(moji)):
    for i in range(len(t)):
        if t[i]==moji[j]:
            moji2=s[i]
        if t[i]==moji2:
            print(moji2)
            if s[i]!=moji2:
                print('No')
                break
        if i == len(t)-1:
            print('Yes')

Submission status: Wrong Answer

Solution code:
S=input()
T=input()

length=len(S)
Smarker=[0]*length
Tmarker=[0]*length

for num1 in range(length):
    for num2 in range(length-num1-1):
        if S[num1]==S[num1+1+num2]:
            Smarker[num1]+=1
        if T[num1]==T[num1+1+num2]:
            Tmarker[num1]+=1

print(Smarker, Tmarker)

Sresult=0
Tresult=0

for num in range(length):
    if Smarker[num]==0:
        Sresult+=1
    if Tmarker[num]==0:
        Tresult+=1
    if Smarker[num]==1:
        Sresult+=10
    if Tmarker[num]==1:
        Tresult+=10
        
print(Sresult, Tresult)

if Sresult==Tresult:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.readline
    s = list(input()[:-1])
    t = list(input()[:-1])
    N = len(s)
    S = {}
    T = {}
    for si, ti in zip(s, t):
        if si in S:
            S[si] += 1
        else:
            S[si] = 1
        if ti in T:
            T[ti] += 1
        else:
            T[ti] = 1

    for si, ti in zip(S, T):
        if S[si] != T[ti]:
            print('No')
            exit()
    print('Yes')


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Wrong Answer

Solution code:
def main():

    S = input()
    T = input()

    if len(S) != len(T):
        return "No"
    d = dict()
    for i in range(len(S)):
        if S[i] not in d:
            d[S[i]] = T[i]
        else:
            if d[S[i]] != T[i]:
                return "No"
    return "Yes"

if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

Solution code:
s = set(input())
t = set(input())
if len(s) != len(t):
    print('No')
else:
    if len(s&t)==0:
        print('No')
    else:
        print('Yes')

Submission status: Wrong Answer

Solution code:
s = set(input())
t = set(input())
if len(s) == len(t):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
from collections import Counter

S = input()
T = input()
N = len(S)

# counter_S = []
# counter = 1
# p = S[0]
# for i in range(1, N):
#     if p != S[i]:
#         counter_S.append(counter)
#         p = S[i]
#         counter = 1
#     else:
#         counter += 1
# counter_S.append(counter)
#
# counter_T = []
# counter = 1
# p = T[0]
# for i in range(1, N):
#     if p != T[i]:
#         counter_T.append(counter)
#         p = T[i]
#         counter = 1
#     else:
#         counter += 1
# counter_T.append(counter)

counter_S = []
counter_T = []
count_S = 1
count_T = 1
p_S = S[0]
p_T = T[0]
for i in range(1, N):
    if p_S != S[i]:
        counter_S.append(count_S)
        p_S = S[i]
        count_S = 1
    else:
        count_S += 1
    if p_T != T[i]:
        counter_T.append(count_T)
        p_T = T[i]
        count_T = 1
    else:
        count_T += 1
counter_S.append(count_S)
counter_T.append(count_T)

print(counter_S)
print(counter_T)

length_CS = len(counter_S)
length_CT = len(counter_T)

if length_CS != length_CT:
    print("No")
else:
    flag = True
    for i in range(length_CS):
        if counter_S != counter_T:
            flag = False
            break
    if flag:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
from collections import Counter

S = input()
T = input()
N = len(S)

counter_S = []
counter = 1
p = S[0]
for i in range(1, N):
    if p != S[i]:
        counter_S.append(counter)
        p = S[i]
        counter = 1
    else:
        counter += 1
counter_S.append(counter)

counter_T = []
counter = 1
p = T[0]
for i in range(1, N):
    if p != T[i]:
        counter_T.append(counter)
        p = T[i]
        counter = 1
    else:
        counter += 1
counter_T.append(counter)

# print(counter_S)
# print(counter_T)

length_CS = len(counter_S)
length_CT = len(counter_T)

if length_CS != length_CT:
    print("No")
else:
    flag = True
    for i in range(length_CS):
        if counter_S != counter_T:
            flag = False
            break
    if flag:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
from collections import Counter

S = input()
T = input()

counter_S = Counter(S)
counter_T = Counter(T)
length_CS = len(counter_S)
length_CT = len(counter_T)

# print(counter_S)
# print(counter_T)

if length_CS != length_CT:
    print("No")
else:
    flag = True
    list_CS = list(counter_S.values())
    list_CT = list(counter_T.values())
    for i in range(length_CS):
        if list_CS[i] != list_CT[i]:
            flag = False
            break
    if flag:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution 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])
temps.sort()
tempt.sort()
if temps==tempt:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution 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")

Submission status: Wrong Answer

Solution code:
s=str(input())
t=str(input())
temps=list(set(s))
tempt=list(set(t))
temps=sorted(temps)
tempt=sorted(tempt)
temps1=[0]*len(temps)
tempt1=[0]*len(tempt)

for i in range(0,len(temps)):
  temps1[i]=s.count(temps[i])
for i in range(0,len(tempt)):
  tempt1[i]=t.count(tempt[i])
if temps1==tempt1:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s=str(input())
t=str(input())
temps=list(set(s))
tempt=list(set(t))
temps=sorted(temps)
tempt=sorted(tempt)
for i in range(0,len(temps)):
  temps[i]=s.count(temps[i])
for i in range(0,len(tempt)):
  tempt[i]=t.count(tempt[i])
if temps==tempt:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s=str(input())
t=str(input())
temps=list(set(s))
tempt=list(set(t))
temps=sorted(list(temps))
tempt=sorted(list(tempt))
for i in range(0,len(temps)):
  temps[i]=s.count(temps[i])
for i in range(0,len(tempt)):
  tempt[i]=t.count(tempt[i])
if temps==tempt:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s=str(input())
t=str(input())
s=sorted(list(s))
t=sorted(list(t))
temps=list(set(s))
tempt=list(set(t))
for i in range(0,len(temps)):
  temps[i]=s.count(temps[i])
for i in range(0,len(tempt)):
  tempt[i]=t.count(tempt[i])
if temps==tempt:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s=str(input())
t=str(input())
s=sorted(list(s))
t=sorted(list(t))
temps=list(set(s))
tempt=list(set(t))
for i in range(0,len(temps)):
  temps[i]=s.count(temps[i])
for i in range(0,len(tempt)):
  tempt[i]=s.count(tempt[i])
if temps==tempt:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s=str(input())
t=str(input())
print("Yes")

Submission status: Wrong Answer

Solution code:
import sys

S = input()
T = input()

changes = {}
changes_reverse = {}
for i in range(len(T)):
    #print(changes)
    if S[i] != T[i]:
        if S[i] in changes:
            if changes[S[i]] != T[i]:
                print('No')
                sys.exit(0)
        if T[i] in changes_reverse:
            if changes_reverse[T[i]] != S[i]:
                print('No')
                sys.exit(0)

        changes[S[i]] = T[i]
        changes_reverse[T[i]] = S[i]

print('Yes')
# print(changes)

Submission status: Wrong Answer

Solution code:
import sys

S = input()
T = input()

changes = {}
for i in range(len(T)):
    #print(changes)
    if S[i] != T[i]:
        if S[i] in changes:
            if changes[S[i]] != T[i]:
                print('No')
                sys.exit(0)
        if T[i] in changes:
            if changes[T[i]] != S[i]:
                print('No')
                sys.exit(0)

        changes[S[i]] = T[i]
        changes[T[i]] = S[i]

print('Yes')

Submission status: Wrong Answer

Solution code:
import sys

S = input()
T = input()

changes = {}
for i in range(len(T)):
    print(changes)
    if S[i] != T[i]:
        if S[i] in changes:
            if changes[S[i]] != T[i]:
                print('No')
                sys.exit(0)
        if T[i] in changes:
            if changes[T[i]] != S[i]:
                print('No')
                sys.exit(0)

        changes[S[i]] = T[i]
        changes[T[i]] = S[i]

print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
dic1={}
dic2={}
for i in range(len(S)):
    s = S[i]
    t = T[i]
    if s!=t:
        if (s not in dic1) and (t not in dic2):
            dic1[s]=t
            dic2[t]=s
        elif (s in dic1) and (t in dic2):
            if dic1[s]!=t:
                print('No')
                break
            else:
                continue
        else:
            print('No')
            break
else:
    print('Yes')