Problem:


Score : 200 points

Problem Statement

You are given string S and T consisting of lowercase English letters.

Determine if S equals T after rotation.

That is, determine if S equals T after the following operation is performed some number of times:

Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.

Here, |X| denotes the length of the string X.

Constraints

2 \leq |S| \leq 100

|S| = |T|

S and T consist of lowercase English letters.

Input

Input is given from Standard Input in the following format:

S
T

Output

If S equals T after rotation, print Yes; if it does not, print No.

Sample Input 1

kyoto
tokyo

Sample Output 1

Yes

In the first operation, kyoto becomes okyot.

In the second operation, okyot becomes tokyo.

Sample Input 2

abc
arc

Sample Output 2

No

abc does not equal arc after any number of operations.

Sample Input 3

aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Sample Output 3

Yes



Sample input:
kyoto
tokyo


Sample output:
Yes

Submission status: Wrong Answer

Solution code:

s1 = input()
s2 = input()
s2 = s2 * 2
for i in range(len(s1)):
    if s2[i] == s1[0]:
        for j in range(len(s1)):
            if s2[i + j] != s1[j]:
                print("No")
                exit()
        
        print("Yes")
        exit()

Submission status: Wrong Answer

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = list(iss())
    T = list(iss())
    for s in S:
        if s not in T:
            print('No')
            exit()

    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from collections import deque

s = deque(input())
t = deque(input())
n=len(s)

yes = False
for _ in range(n-1):
    if s == t:
        yes = True
        break
    s.rotate()

print('Yes' if yes else 'No')

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
f=False
for i in range(len(t)):
  if s==t[i:]+t[:i]:
    print("Yes")
    break
  if i==len(t):
    print("No")

Submission status: Wrong Answer

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

for i in range(100):
  if S[-1-i:-1:-1]+S[0:100-i] ==T:
    print("Yes")
    break
else:
  print("No")

Submission status: Wrong Answer

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

for i in range(100):
  if S[-1-i:-1]+S[0:100-i] ==T:
    print("Yes")
    break
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import sys

S = input()
T = input()

for i in range(len(S)):
  s = S[i:] + S[:i]
  if S == T:
    print('Yes')
    sys.exit()
    
print('No')

Submission status: Wrong Answer

Solution code:
s = input()
ans = ""
for i in list(s):
	if i == "0" or i == "1":
		ans += i
	else:
		ans = ans[:-1]
print (ans)

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
a=0
while(s!=t):
	s =s[-1]+s[:-1]
	a+=1
	if a==len(s):
		print("NO")
		break
if s==t:
	print("YES")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
if set(s) == set(t):
  for i in set(s):
    if s.count(i) != t.count(i):
      break
      print('No')
      exit()
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

for i in range(len(s)):
    compstr = s[i:] + s[0:i]
    if compstr == t:
        print("yes", end="")
        exit()
print("no", end="")

Submission status: Wrong Answer

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

for i in range(len(s)):
    compstr = s[i:] + s[0:i]
    if compstr == t:
        print("yes")
        exit()
print("no")

Submission status: Wrong Answer

Solution code:
import sys
a =input()
a = [str(c) for c in a]
b =input()
b = [str(c) for c in b]

c=len(b)
t=0
for i in range(0,c+1):
	a.append(a[0])
	del a[0]
	if a==b:
		print('Yes')
		t=1
		sys.exit
if t==0:
	print('No')

Submission status: Wrong Answer

Solution code:
print("YNeos"[sorted(input())!=sorted(input())::2])

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
ss=s+s
n=len(s)
for i in range(n):
  if ss[i:]==t:
    print("Yes")
    exit(0)

print("No")

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
ss=s+s
if t in s:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = str(input())
t = str(input())
list_s = list(s)
list_t = list(t)
list_s.sort()
list_t.sort()
if list_s == list_t:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
s.sort()
t.sort()
if s == t:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

for i in s:
    if i in t:
        t.remove(i)
if not t:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
f = False
l = len(s)
p = ["" for _ in range(l)]
for i in range(l):
	if s == p: 
		f = True
		break
	for j in range(l):
		p[(j+i)%l] = t[j]
if f: print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
f = False
l = len(s)
p = ["" for _ in range(l)]
for i in range(l):
	if s == p: 
		print("as")
		f = True
		break
	for j in range(l):
		p[(j+i)%l] = t[j]
if f: print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
f = False
l = len(s)
p = list("a"*l)
for i in range(l):
	if s == p: 
		f = True
		break
	for j in range(l):
		p[(j+i)%l] = t[j]
if f: print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
s.sort()
t.sort()
if s == t:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
if s == t:
    print('Yes')
else:
    ns = s[-1] + s[0:-1]
    while ns != s:
        ns = ns[-1] + ns[0:-1]
        if ns == t:
            print('Yes')
            break
    else:
        print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=str(input())
T=str(input())
flag=0
for i in range(len(S)):
    if S!=T:
        k=str(S[-1])
        S=S.strip(k)
        S=k+S
    else:
        flag=1
print('Yes' if flag==1 else 'No')

Submission status: Wrong Answer

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

if S == T:
    print('Yes')
l = len(S)
L = list(S)
for i in range(l):
    a = L[0]
    del L[0]
    L.append(a)
    s = ''.join(L)
    if s == T:
        print('Yes')
        break
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
if s == t:
    print("Yes")
    quit()
for i in range(1,len(s)):
    s_remain = s[:len(s)-i]
    s_tofront = s[len(s)-i:]
    print(s_tofront + s_remain)
    if s_tofront + s_remain == t:
        print("Yes")
        quit()
print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
for i in range(len(S)):
    if S[i] != T[i]:
        cnt += 1
    else:
        cnt = cnt

if cnt%2 == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

if sorted(S) == sorted(T):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

s.sort()
t.sort()

if s == t:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s1 = input()
s2 = input()

S1 = []
S2 = []
for i, j in zip(s1, s2):
    S1.append(i)
    S2.append(j)

S1 = sorted(S1)
S2 = sorted(S2)

if S1 == S2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()
T=input()
for i in range(1,len(S)):
    if S[-i:]+S[:-i]==T:
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
S=input()
T=input()
for i in range(1,len(S)):
    if S[-i:]+S[:-i]==T:
        print('Yes')
        exit
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = list(input())
b = list(input())
#print(a)
#print(b)
for i in range(len(a)-1):
    a.insert(0, a.pop(-1))
    #print(a)
    if a == b:
        print('Yes')
        break
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
X = 0
for i in range(len(S)):
  S = S[-1] + S[:-1] 
  print(S)
  if S == T:
    X = 1

if X == 0:
  print('No')
elif X == 1:
  print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
X = 0
for i in range(len(S)):
  S = S[-1] + S.rstrip(S[-1]) 
  if S == T:
    X = 1

if X == 0:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

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

def rolling(word, n):
    return word[n:len(word)] + word[:n]

for i in range(length-1):
    if rolling(s, i) == t:
        print('Yes')
        exit()

print('No')

Submission status: Wrong Answer

Solution code:
Ss=input()
Ts=input()
s=[_ for _ in Ss]
t=[_ for _ in Ts]
l=len(Ss)
for i in range(l):
  temp=s[l-1]
  for j in range(l-1,-1,-1):
    s[j]=s[j-1]
  else:
    s[0]=temp
  print(s)
  if s==t:
    res='Yes'
    break
else:
  res='No'
print(res)

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 = set(input())
T = set(input())

print(S == T)

Submission status: Wrong Answer

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

cnt = 0
while cnt <= len(s):
    s = s[-1] + s[:-1]
    if s == t:
        print("YES")
        exit()
    cnt+=1
print("NO")

Submission status: Wrong Answer

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

if S == T:
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = str(input())
T = str(input())
for i in range(len(S)):
    if S[i] != T[-(i+1)]:
        print("No")
        break
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
S = str(input())
T = str(input())
for i in range(len(S)):
    if S[i-1] != T[-i]:
        print("No")
        break
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
a=input()
b=input()
a=sorted(a)
b=sorted(b)
if a==b:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

if sorted(s) == sorted(t):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
L = len(S)
St = []
Tr = []
ans = 'no'
for i in range(L):
    St.append(S[i:i+1])
    Tr.append(T[i:i+1])

for i in range(L):
    if St == Tr:
        ans = 'yes'
        break
    else:
        St.insert(0,St[L-1])
        del St[L]

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
L = len(S)
St = []
Tr = []
ans = 'no'
for i in range(L):
    St.append(S[i:i+1])
    Tr.append(T[i:i+1])
print(St)
for i in range(L):
    if St == Tr:
        ans = 'yes'
    else:
        St.insert(0,St[L-1])
        St.remove(St[L-1])

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
L = len(S)
St = []
Tr = []
ans = 'no'
for i in range(L-1):
    St.append(S[i:i+1])
    Tr.append(S[i:i+1])
for i in range(L):
    if St == Tr:
        ans = 'yes'
    else:
        St.insert(0,St[L-1])
        St.remove(St[L-1])

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
S = list(input())
T = list(input())
del S[-1]
del T[-1]
l = len(S)
ans = "No"
for i in range(l) :
    a = S[-1]
    del (S[-1])
    S.insert(0,a)
    print(S)
    if S == T :
        ans = "Yes"
        break
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
for i in range(len(s)):
    if s[-i-1:0]+s[0:-i-1]==t:
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
n = len(s)
ok = False
for i in range(n):
  for j in range(n):
    temp = True
    if s[j] != t[(i+j)%n]:
      temp = False
    ok = ok or temp
print("Yes" if ok else "No")

Submission status: Wrong Answer

Solution code:
old_str = input()
compare_str = input()
if old_str[::-1] == compare_str:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys

S = input()
T = input()


for i in range(len(S)):
    if S==T:
        print(S)
        print(T)
        print("Yes")
        sys.exit()
    S = S[len(S)-1]+S[0:len(S)-1]


print("No")

Submission status: Wrong Answer

Solution code:
import sys

S = input()
T = input()


for i in range(len(S)-1):
    if S==T:
        print("Yes")
        sys.exit()
    S = S[len(S)-1]+S[0:len(S)-1]

print("No")

Submission status: Wrong Answer

Solution code:
S=input()
T=input()
s=[]
t=[]
for i in range(len(S)):
    s.append(S[i])
for i in range(len(T)):
    t.append(T[i])
from collections import Counter
x=Counter(s)
y=Counter(t)
print("Yes" if x==y else "No")

Submission status: Wrong Answer

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

ans = 'No'
for _ in range(len(S)-1):
    if S == T:
        ans = 'Yes'
        break
    S = S[-1] + S[:-1]

print(ans)

Submission status: Wrong Answer

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

ans = 'No'
for _ in range(len(S)-1):
    if S == T:
        ans = 'Yes'
        break
    S = S[-1] + S[:-1]
    print(S)

print(ans)

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:
s = input()
t = input()
l = len(s) - 1
for i in range(l):
    s = s[-1] + s[:-1]
    if s == t:
        ans = 'Yes'
        print(ans)
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
import sys
s = input()
t = input()
flag = False

for i in range(len(s)-1):
    tmp = s[i:] + s[:i]
    if t == tmp:
        flag = True
        break

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

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
 
for i in range(len(s)):
  if s[i:]+s[:i] != t:
    j=0 
  else:
    j=1
    break

if j==1:
  print("yes")
else:
  print("no")

Submission status: Wrong Answer

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

for i in range(len(s)):
  if s != t[i:]+t[:i]:
    j=0 
    
  else:
    j=1
    break

if j==1:
  print("yes")
else:
  print("no")

Submission status: Wrong Answer

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

for i in range(len(S)):
  if S == T[i:]+T[:i]:
    j = 1
    break
  else:
    j = 0

if j == 1:
  print("yes")
else:
  print("no")

Submission status: Wrong Answer

Solution code:
import sys

S = list(input())
T = list(input())

for i in range(len(S)):
  if S == (T[i:]+T[0:i]):
    print("yes")
    sys.exit()
    
print("no")

Submission status: Wrong Answer

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

lisS = list(S)
lisT = list(T)

A=sorted(lisS)
B=sorted(lisT)

if A == B:
    print("Yes") 
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a=input()
t=input()
for i in range(len(a)):
  S=a[-i:]+a[:-i]
  if S==t:
    print("YES")
    break
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S=list(input())
T=list(input())
for _ in range(len(S)):
  if S==T:
    print("Yes")
  S.insert(0,S.pop(-1))
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = input()

ss = s+s
num = len(s)
for i in range(len(ss)-num):
  if ss[i:num] == s:
    print("Yes")
    exit()
print("No")

Submission status: Wrong Answer

Solution code:
a = input()
b = input()
for i in range(101):
  if a == b:
    print("Yes")
  a = a[-1]+a[:-2]
else:
  print("No")

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:
S, T = list(input()), list(input())
# print(S, T)


def create_new_T(_old_T):
  _newT = []
  for i in range(0, len(_old_T)):
    if i == 0:
      _newT.append(T[len(T) - 1])
    else:
      _newT.append(T[i - 1])
  return _newT

count = 0

for i in range(0, len(T)):
  T = create_new_T(T)
  if T == S:
    count = 1
    print("Yes")

if count == 0:
  print("No")

Submission status: Wrong Answer

Solution code:
S = list(input())
T = list(input())
S.sort()
T.sort()
if S == T:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
A = input()
B = input()
A=sorted(A)
B=sorted(B)
if A == B:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
A = input()
B = input()
A=sorted(A)
B=sorted(B)
if A == B:
  print('Yse')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a = sorted(list(input()))
b = sorted(list(input()))
if a ==  b:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a = list(input())
b = list(input())
c = list(reversed(a))
if a ==  b:
    print("Yes")
elif b ==c:
    print("yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a = list(input())
b = list(input())
c = list(reversed(a))
if a ==  b:
    print("yes")
elif b ==c:
    print("yes")
else:
    print("no")

print(a,b,c)

Submission status: Wrong Answer

Solution code:
import copy

S = list(input())
T = list(input())
Stmp = copy.copy(S)

if S == T:
    print("Yes")
else:
    flg = False
    s = S.pop(-1)
    S.insert(0, s)

    while Stmp != S:
        s = S.pop(-1)
        S.insert(0, s)
        if S == T:
            flg = True
            break

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

Submission status: Wrong Answer

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

S.sort()
T.sort()

if S == T:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S= list(input())
S = sorted(S , reverse =True)
T= list(input())
T = sorted(T , reverse =True)
if S == T :
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

ans = False
for i in range(len(s)+1):
  if s == t:
    ans = True
    break 
  s = s[-1] + s[:-1]

if ans :
  print("yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
print('Yes' if (''.join(sorted(input())) == ''.join(sorted(input()))) else 'No')

Submission status: Wrong Answer

Solution code:
print('Yes' if (sorted(input()) == sorted(input())) else 'No')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
leng = len(S)
S = sorted(S)
T = sorted(T)
ans = True
for i in range(leng):
    if(S[i] != T[i]):
        ans = False
if(ans):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = str(input())
t = str(input())
ans='No'
if s==t:
    ans='Yes'
else:
    n = t.count(s[0])
    i=0
    while i < n:
        j = t.index(s[0])
        t = t[j:] + t[0:j]
        if s==t:
            ans='Yes'
            break
        i+=1
print(ans)

Submission status: Wrong Answer

Solution code:
s = str(input())
t = str(input())
ans='No'
if s==t:
    ans='Yes'
else:
    n = t.count(s[0])
    for i in range(n):
        ind = t.index(s[0])
        t = t[ind:] + t[0:ind]
        if s==t:
            ans='Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
s = str(input())
t = str(input())
ans='No'
if s==t:
    ans='Yes'
else:
    n = t.count(s[0])
    for i in range(n):
        ind = t.index(s[0])
        tmp = t[ind:] + t[0:ind]
        if s==tmp:
            ans='Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
A = sorted(list(input()))
T = sorted(list(input()))
 
ans = 'Yes'
 
for i in range(len(A)):
  if A[i] != T[i]:
    ans = 'No'
    
print(ans)

Submission status: Wrong Answer

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

for c in "abcdefghijklmnopqrstuvwxyz":
  if s.count(c) != t.count(c):
    print('No')
    exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
for c in "abcdefghijklmnopqrstuvwxyz":
  if s.count(c) != t.count(c):
    print('No')
    exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
import sys
s = input()
t = input()
for i in range(len(s)-1):
    if s == t:
        print('Yes')
        sys.exit()
    s = s[1:] + s[0]
print('No')

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
tmps = s[-1] + s[:-1]
while True:
	tmps = tmps[-1] + tmps[:-1]
	if tmps == t or tmps != s:
		print ("Yes")
		exit()
print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
tmps = s[-1] + s[:-1]
while tmps != s:
	tmps = tmps[-1] + tmps[:-1]
	if tmps == t:
		print ("Yes")
		exit()
print("No")

Submission status: Wrong Answer

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

cur = T.find(S[0])
i = 0
con = len(S)

while con != 0:
  if S[i] == T[cur]:
    con -= 1
    
    if con == 0:
      print("Yes")
    
    i += 1
    if cur == (len(S) - 1):
      cur = 0
    else:
      cur += 1
  else:
    print("No")
    break

Submission status: Wrong Answer

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

cur = T.find(S[0]) #2
i = 0
con = len(S)

while con > 0:
  if S[i] == T[cur]:
    con -= 1
    i += 1
    if cur == (len(S) - 1):
      cur = 0
    else:
      cur += 1
  else:
    print("No")
    break

if con == 0:
  print("Yes")

Submission status: Wrong Answer

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

flag = False
for i in range(len(S)):
    x = T[0]
    T = T[1:]
    T = T + x
    print(T)
    print(S)
    if T == S:
        flag = True
        break
    
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

flag = False
for i in range(len(S)):
    x = T[0]
    T = T.lstrip(x)
    T = T + x
    if T == S:
        flag = True
        break
    
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def rotate(i):
  return S[i+1:] + S[:i+1]

S = input()
T = input()

for i in range(len(S)):
  if T == rotate(i):
    print("Yes", i)
    exit()

print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if s == t:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import sys
s = str(input())
t = str(input())
for i in range(len(s)):
    s = s[-1] + s[:len(s)-1]
    print(s)
    if s == t:
        sys.exit()
print('No')

Submission status: Wrong Answer

Solution code:
import sys
s = str(input())
t = str(input())
for i in range(len(s)):
    s = s[-1] + s[:len(s)-1]
    print(s)
    if s == t:
        print('Yes')
        sys.exit()
print('No')

Submission status: Wrong Answer

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

print(S)
print(T)
for i in range(len(S)):
    check_str = "".join(S[i:len(S)] + S[0:i])
    #print(check_str)
    if check_str == T:
        print("Yes")
        exit()

print("No")

Submission status: Wrong Answer

Solution code:
s = sorted([i for i in input()])
t = sorted([i for i in input()])

print('Yes' if s == t else 'No')

Submission status: Wrong Answer

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

print("Yes" if s == t else "No")

Submission status: Wrong Answer

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

ans = ''.join(set(s))
aim = ''.join(set(t))
for i in range(len(ans)):
    for j in range(len(aim)):
        if ans[i] == aim[j]:
            count +=1
if count == len(ans):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

ans = ''.join(set(s))
aim = ''.join(set(t))
for i in range(len(ans)):
    for j in range(len(aim)):
        if ans[i] == aim[j]:
            count +=1
if count == len(ans):
    print('Yes')
else:
    print('NO')

Submission status: Wrong Answer

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

s = list(S)
ans = 0

if S.lower() == T.lower():
        ans +=1

for _ in  range(len(s)-1):
    A=s[-1]
    s.pop(-1)
    s.insert(0,A)
    print(s)
    B=''.join(s)
    if B.lower() == T.lower():
        ans +=1
if ans != 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

ans = 0
for i in  range(len(S)-1):
    A=S[-1]
    S.pop(-1)
    S.insert(0,A)
    B=''.join(S)
    if B.lower() == T.lower():
        ans +=1
if ans != 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

ans = 0
for i in  range(len(S)-1):
    A=S[-1]
    S.pop(-1)
    S.insert(0,A)
    B=''.join(S)
    if B.lower() == T:
        ans +=1
if ans != 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def solve(s,t):
    if(s == t):
        return "Yes"
    for i in range(len(s)-1,0,-1):
        f = s[i:] + s[:i]
        print(f)
        if(f == t):
            return "Yes"
    return "No"

s = input()
t = input()
print(solve(s,t))

Submission status: Wrong Answer

Solution code:
def solve(s,t):
    for i in range(len(s)-1,0,-1):
        f = s[i:] + s[:i]
        if(f == t):
            return "Yes"
    return "No"

s = input()
t = input()
print(solve(s,t))

Submission status: Wrong Answer

Solution code:
import collections
A = collections.Counter(input())
B = collections.Counter(input())
if sorted(A.items())==sorted(B.items()):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import collections
A = collections.Counter(input())
B = collections.Counter(input())
if A==B:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

for i in range(len(s)):
      s=s[-1]+s[:-1]
      print(s)
      if s==t:
            print("Yes")
            exit()
print("No")

Submission status: Wrong Answer

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

if len(s)!=len(t):
      print("No")
      exit()
elif s==t:
      print("Yes")
      exit()

for i in range(len(s)):
      if s.append(s.pop(0))==t:
            print("Yes")
            exit()
print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = list(input())
T = input()
for i in range(len(S)):
  tmp = S
  tmp1 = S[:i]
  del S[:i]
  tmp.extend(tmp1)
  if "".join(tmp) ==T:
    print('Yes')
    break
else:
  print('No')

Submission status: Wrong Answer

Solution code:
from collections import Counter
s = Counter(input())
t = Counter(input())
print("YNeos"[s!=t::2])

Submission status: Wrong Answer

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

s = S
for i in range(len(S) - 1):
    if s == T:
        print('Yes')
        break
    s = s[-1:] + s[:-1]


if s != T:
    print('No')

Submission status: Wrong Answer

Solution code:

def count_diff(a,b):
    """
    コードを単純化
    """
    cnt = 0
    for c in a:
        if not(c in b):
            return False
    for c in b:
        if not(c in a):
            return False
    return True

def main():
    S = str(input())
    T = str(input())

    if(S==T):
        print('Yes')
        return
    if(count_diff(S,T)):
        print('No')
        return
    
    #操作の時間
    length_S = len(S)
    ch_S = S
    for i in range(length_S):
        ch_S = ch_S[length_S-1] + ch_S[0:length_S-1]
        if(ch_S == T):
            print('Yes')
            return
    print('No')



if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:

def count_diff(a,b):
    """
    コードを単純化
    """
    cnt = 0
    for c in a:
        if not(c in b):
            cnt += 1
    return cnt

def main():
    S = str(input())
    T = str(input())

    if(S==T):
        print('Yes')
        return
    count = count_diff(S,T)
    if(count > 0):
        print('No')
    
    #操作の時間
    length_S = len(S)
    ch_S = S
    for i in range(length_S):
        ch_S = ch_S[length_S-1] + ch_S[0:length_S-1]
        print(ch_S)
        if(ch_S == T):
            print('Yes')
            return
    print('No')



if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from collections import deque
s=list(input())
s=deque(s)
t=input()
for i in range(len(s)):
    s.appendleft(s.popleft())
    if t=="".join(s):
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
s=list(input())
t=input()
for i in range(len(s)):
    s.insert(0,s.pop(-1))
    word="".join(s)
    if s==t:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
s=list(input())
t=input()
for i in range(len(s)):
    s.insert(0,s.pop())
    word="".join(s)
    if s==t:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
if sorted(input()) == sorted(input()):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import collections
if collections.Counter(input()) == collections.Counter(input()):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter

input = sys.stdin.readline


def main():
    s = Counter(input().strip())
    t = Counter(input().strip())
    print("Yes" if s == t else "No")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

for i in range(1, len(s)):
    if s[i:] + s[:i] == t:
        print("Yes")
        break
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys


S = input()
T = input()

for i in range(len(S)-1):
    if S == T:
        print('Yes')
        sys.exit()
    else:
        S = S[-1] + S[:-1]

print('No')

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
flag=0
for i in range(1,len(s)):
    if s==t:
        flag=+1
        break
    else:
        s.insert(0,s.pop())
if len(s)==2:
    if s==t:
        flag=+1
    else:
        s.insert(0,s.pop())
        if s == t:
            flag = +1
if flag>0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
flag=0
for i in range(len(s)-1):
    if s==t:
        flag=+1
        break
    else:
        s.insert(0,s.pop())
if flag>0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=list(input())
t=input()
for S in s:
    if S not in t:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
import sys

s = input()
t = input()

temp = ''
for i in range(len(s)):
    temp += s[-1]
    temp += s[0:len(s)-1]
    print(temp)
    if temp == t:
#        print('Yes')
        sys.exit()
    else:
        s = temp
        temp = ''

print('No')

Submission status: Wrong Answer

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

if all(s[i] == t[-i-1] for i in range(len(s))):
    print('Yes')
else:
    print('No')