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:
S=input()
T=input()
D=S[-1]+S
T=T+T[0]
if D==T:
    print('Yes')
else :
    print('No')

Submission status: Wrong Answer

Solution code:
ans = []
a,b = input(),input()
for _ in range(len(a)):
    st =  a[(len(a)-1)-_:]+a[:((len(a)-1)-_)]
    ans.append(st)
print("Yes"if b in ans else "NO")

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
a=[]
b=[]
for i in s:
	a.append(i)
for i in t:
	b.append(i)
a=sorted(a)
b=sorted(b)
f=1
for i in range(len(b)):
	if b[i] not in a:
		f=0
		break
if f==0:
	print("No")
else:
	print("Yes")

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
s.sort()
t.sort()
jugde=True
for i in range(len(s)):
    if s[i]!=t[i]:
        jugde=False
if jugde:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np

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

i = 0
if len(S) != len(T):
    print("No")
else:
    while True:
        S1 = np.roll(S,-1)
        i += 1
        if set(S1) == set(T):
            print("Yes")
            break
        elif i > len(S):
            print("No")
            break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def f(S):
    C = {}
    for c in S:
        C[c] = C.get(c, 0) + 1
    return C
print("Yes" if f(S) == f(T) else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
a_in = input()
b_in = input()
a = list(a_in)
b = list(b_in)
an = np.array(a)
bn = np.array(b)
no = 0
for i in an:
  if len( np.where(bn==i)[0] ) == len( np.where(an==i)[0] ):
    pass
  else:
    no = 1
    print("No")
    break
    
if no == 0:
  print("Yes")

Submission status: Wrong Answer

Solution code:
import numpy as np
a_in = input()
b_in = input()
a = list(a_in)
b = list(b_in)
an = np.array(a)
bn = np.array(b)
no = 0
for i in an:
  if len( np.where(bn==i)[0] ) == len( np.where(an==i)[0] ):
    pass
  else:
    no = 1
    print("No")
    break
    
for i in bn:
  if len( np.where(bn==i)[0] ) == len( np.where(an==i)[0] ):
    pass
  else:
    no = 1
    print("No")
    break
    
if no == 0:
  print("Yes")

Submission status: Wrong Answer

Solution code:
import numpy as np
a_in = input()
b_in = input()
a = list(a_in)
b = list(b_in)
an = np.array(a)
bn = np.array(b)
no = 0
for i in an:
  #print(i,np.where(bn==i))
  #print(i,len(np.where(bn==i)[0] ) )
  if len( np.where(bn==i)[0] ) == len( np.where(an==i)[0] ):
    pass
  else:
    no = 1
    print("No")
    break
    
if no == 0:
  print("Yes")

Submission status: Wrong Answer

Solution code:
import numpy as np
a_in = input()
b_in = input()
a = list(a_in)
b = list(b_in)
an = np.array(a)
bn = np.array(b)
no = 0
for i in an:
  #print(i,np.where(bn==i))
  #print(i,len(np.where(bn==i)[0] ) )
  if len( np.where(bn==i)[0] ) == 1:
    pass
  else:
    no = 1
    print("No")
    break
    
if no == 0:
  print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


for i in range(len(t)):
    if s[0]==t[i]:
        for j in range(len(s)):
            if j+i+1<=len(s):
                if s[j]==t[j+i]:
                    k+=1
            else:
                if s[j]==t[j+i-len(s)]:
                    k+=1
    if k<len(s):
        k=0
                
if k==len(s):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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


for i in range(len(t)):
    if s[0]==t[i]:
        for j in range(len(s)):
            if j+i+1<=len(s):
                if s[j]==t[j+i]:
                    k+=1
            else:
                if s[j]==t[j+i-len(s)]:
                    k+=1
    if k!=len(s):
        k=0
                
if k==len(s):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


for i in range(len(t)):
    if s[0]==t[i]:
        for j in range(len(s)):
            if j+i+1<=len(s):
                if s[j]==t[j+i]:
                    k+=1
            else:
                if s[j]==t[j+i-len(s)]:
                    k+=1
               
if k==len(s):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S_list = input().split()
T_list = input().split()

for i, s in enumerate(S_list):
    if s in T_list:
        if  i != len(S_list):
            continue
        else:
            print("Yes")
    else:
        print("No")
        break

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
flg = True
for i in range(0,len(S)):
    if S[i] == T[-i]:
        continue
    else:
        print('No')
        flg = False
        break

if flg:
    print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
flg = True
for i in range(0,len(S)):
    if S[i] == T[-i]:
        continue
    else:
        print('No')
        flg = False

if flg:
    print('Yes')

Submission status: Wrong Answer

Solution code:

def B():
    s1 = input()
    s2 = input()
    
    YES = 'Yes'
    NO = 'No'
    
    result = NO
    for i in range(len(s1)):
        p = s1[i:] + s1[:i]
        if(not p is s2):
            result = YES
    
    print(result)

if __name__ =='__main__':
    B()

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
flag=False
a=s.index(t[0])
for i in range(len(s)):
  b=i+a
  if i+a>=len(s):
    b=i+a-len(s)
  if s[b]==t[i]:
    flag=True
print('Yes' if flag else 'No')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
l = len(S)
ok = 1
for i in range(l):
   T = T[l-1]+T[0:l-1]
   print(T)
   if S==T:
      print("Yes")
      break
   elif l-1==i:
      print("No")
      break

Submission status: Wrong Answer

Solution code:
def spaceinput():
    return list(map(int,input().split(" ")))

def rotate(s):
    return s[-1]+s[:-1]

s=input()
s2=input()

def chk(s,s2):
    for i in range(len(s)):
        print(s2)
        if s==s2:
            return True
        s2=rotate(s2)
        print(s2)
    return False

if chk(s,s2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
flag=False
if sorted(s)==sorted(t):
  a=s.index(t[0])
  for i in range(len(s)):
    b=i+a
    if i+a>=len(s):
      b=i+a-len(s)
    if s[b]==t[i]:
      flag=True
print('Yes' if flag else 'No')

Submission status: Wrong Answer

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

for i in range(0,len(S)):
	if S[i] == T[-i]:
		continue
	else:
		print('No')
		break
else:
	print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
l = len(S)
ok = 1
for i in range(l):
   T = T[l-1]+T[0:l-1]
   if S==T:
      print("Yes")
      break
   elif l==i:
      print("No")
      break

Submission status: Wrong Answer

Solution code:
s = input()
t=input()
keyword=s[0]
start=t.find( keyword)
circulate=t[start::]+t[0:start]
print("Yes") if s==circulate else print("No")

Submission status: Wrong Answer

Solution code:
import sys

s = input()
t = input()

a = int(len(s))

for i in range(0,a) :
    s = s[a-1::]+s[:a-1:]
    print(s)
    if s == t :
        print("Yes")
        sys.exit()

print("No")

Submission status: Wrong Answer

Solution code:
T = raw_input()
Tlist = list(T)
S = raw_input()

i = 0
while i < len(Tlist):
  i = i+1
  Tword = ''
  for j in range(0,len(Tlist)):
    Tword = Tword + Tlist[j]

  if Tword == S:
    print('Yes')
    break

  Tlist[0] = Tlist[-1]
  for j in range(1,len(Tlist)-1):
    Tlist[j] = Tlist[j-1]

if Tword != S:
  print('No')

Submission status: Wrong Answer

Solution code:
input_x = str(input())
input_y = str(input())
list_x = sorted(set(input_x))
list_y = sorted(set(input_y))
if list_x == list_y:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:

def B():
    s1 = input()
    s2 = input()
    
    YES = 'Yes'
    NO = 'No'
    
    s1list = [a for a in s1]
    s2list = [a for a in s2]
    s1list.sort()
    s2list.sort()
    
    result = YES
    for(a1,a2) in zip(s1list,s2list):
        print(a1 is a2)
            #result = NO
    print(result)

if __name__ =='__main__':
    B()

Submission status: Wrong Answer

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

for s in S:
    for i,t in enumerate(T):
        if t == s:
            del T[i]

if T == []:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
s1 = list(s)
t1 = list(t)
ls = len(s1)
ls1=ls-1
lt = len(t1)
z=0
if s1 == t1:
	print("Yes")
elif s1!=t1:
    for i in range(ls-1):
        x = s1[0]
        y = s1[ls1]
        del s1[ls1]
        s1.insert(0,y)
        if s1 == t1:
            print("Yes")
            z = 1
if z == 0:
    print("No")

Submission status: Wrong Answer

Solution code:
from sys import stdin                                                                                                                                                                                       
S = stdin.readline().rstrip()                                                                                                                                                                               
T = stdin.readline().rstrip()                                                                                                                                                                               
                                                                                                                                                                                                            
sl = list(S)                                                                                                                                                                                                
tl = list(T)                                                                                                                                                                                                
if sl.sort() == tl.sort():                                                                                                                                                                                  
    print("Yes")                                                                                                                                                                                            
else:                                                                                                                                                                                                       
    print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = input()
flag = False
for i in range(len(s)-1):
    if "".join(s) == t:
        flag = True
        break
    else:
        flag = False
    w = s[0]
    for j in range(len(s)-1):
        s[j] = s[j+1]
    s[-1] = w
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np

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

i = 0;
if len(S) != len(T):
    print("No")
else:
    while True:
        S1 = np.roll(S,-1)
        i += 1
        if set(S1) == set(T):
            print("Yes")
            break
        elif i >= len(S):
            print("No")
            break

Submission status: Wrong Answer

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

change = ""
ok = 0

for i in range(len(S)):
  if S[0] == T[i]:
    for j in range(len(S) - i):
      change += T[j+i]
    for k in range(i):
      change += T[k]
    if Spr == change:
      print("Yes")
      ok = 1
    change = ""

if i == len(S) - 1 and ok == 0:
  print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = input()
flag = False
for i in range(len(s)-1):
    if "".join(s) == t:
        flag = True
        break
    else:
        flag = False
    w = s[0]
    for j in range(len(s)-1):
        s[j] = s[j+1]
    s[-1] = w
    print(s)
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
input_x = str(input())
input_y = str(input())
list_x = sorted(input_x)
list_y = sorted(input_y)
if list_x == list_y:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
input_x = str(input())
input_y = str(input())
list_x = str(sorted(input_x))
list_y = str(sorted(input_y))
if list_x == list_y:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# String Rotation

def main():
    s1 = input()
    s2 = input()

    _s = s2

    for i in range(len(s1)-1):
        if s1 == _s:
            print("Yes")
            return
        else:
            _s = rotate(_s)
    print("No")
    return

def rotate(arr):
    return arr[-1] + arr[:-1]


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
A = raw_input()
B = raw_input()
C = A + B
if A in C:
  print "Yes"
else:
  print "No"

Submission status: Wrong Answer

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

if len(s)!=len(t):
    print("No") 
else:
    for i in range(len(t)):
        if s[0]==t[i]:
            for j in range(len(s)):
                if j+i+1<=len(s):
                    if s[j]==t[j+i]:
                        k+=1
                else:
                    if s[j]==t[j+i-len(s)]:
                        k+=1
               
    if k>=len(s):
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
a = []
for i in range(2):
    a.append(list(map(str, input().split())))
num_1 = (a[0])
num_2 = (a[1])
result1 = sorted(str(''.join(num_1)))
result2 = sorted(str(''.join(num_2)))
if result1 == result2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
#coding: utf-8

def checkStr():
    sA = s1
    for i in range(len(s1)):
        sA = sA[len(s1) - 1:len(s1)] + sA[0:len(s1) - 1]
        print (sA)
        if sA == s2:
            return True
    return False

s1 = input()
s2 = input()
if checkStr():
    print ("Yes")
else:
    print ("No")

Submission status: Wrong Answer

Solution code:
import numpy as np

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

i = 0;
while True:
    S1 = np.roll(S,-1)
    i += 1
    if set(S1) == set(T):
        print("Yes")
        break
    elif i >= len(S):
        print("No")
        break

Submission status: Wrong Answer

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

for i in range(len(t)):
    if s[0]==t[i]:
        for j in range(len(s)):
            if j+i+1<=len(s):
                if s[j]==t[j+i]:
                    k+=1
            else:
                if s[j]==t[j+i-len(s)]:
                    k+=1
 
if len(s)!=len(t):
    print("No")                 
elif k>=len(s):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

success = False
for _l in range(len(s)):
    print(s)
    if ''.join(s) == a:
        success = True
        break
    s.insert(0, s.pop())

print("Yes" if success else "No")

Submission status: Wrong Answer

Solution code:
import numpy as np

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

i = 0;
while True:
    S1 = np.roll(S,-1)
    i += 1
    if set(S1) == set(T):
        print("Yes")
        break
    elif i > len(S):
        print("No")
        break

Submission status: Wrong Answer

Solution code:
a = []
for i in range(2):
    a.append(list(map(str, input().split())))
num_1 = (a[0])
num_2 = (a[1])
result1 = sorted(set(''.join(num_1)))
result2 = sorted(set(''.join(num_2)))
if result1 == result2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
input_x = str(input())
input_y = str(input())
list_x = list(input_x)
list_y = list(input_y)
list_x.sort()
list_y.sort()
if list_x == list_y:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

change = []
flag = []
get = 0
flagc = 0

for i in range(len(S)):
  if S[0] == T[i]:
    get += 1
    for j in range(len(S) - i):
      change.append(T[j+i])
    for k in range(i):
      change.append(T[k])
    for check in range(len(S)):
      if S[check] != change[check]:
        flag.append(1)
        i = len(S)- 1
        
for checkflag in range(len(flag)):
  flagc += flag[checkflag]
      
if get == flagc:
  print("No")
else:
  if get >= 1:
    print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
import collections

input_x = str(input())
input_y = str(input())
list_x = list(input_x)
list_y = list(input_y)

x = collections.Counter(list_x)
y = collections.Counter(list_y)
if x == y:
    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:
T = raw_input()
Tlist = list(T)
S = raw_input()

i = 0
while i < len(Tlist):
  i = i+1
  Tword = ''
  for j in range(0,len(Tlist)):
    Tword = Tword + Tlist[j]

  if Tword == S:
    print('Yes')
    break

  last_word = Tlist[-1]
  for j in range(1,len(Tlist)-1):
    Tlist[j] = Tlist[j-1]
  Tlist[0] = last_word

if Tword != S:
  print('No')

Submission status: Wrong Answer

Solution code:
from sys import stdin                                                                                                                                                                                       
S = stdin.readline().rstrip()                                                                                                                                                                               
T = stdin.readline().rstrip()                                                                                                                                                                               
                                                                                                                                                                                                            
if sorted(S) == sorted(T):                                                                                                                                                                                  
    print("Yes")                                                                                                                                                                                            
else:                                                                                                                                                                                                       
    print("No")

Submission status: Wrong Answer

Solution code:
import numpy

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

if set(s) != set(t):
    print('No')

tmp = s[:]
for i in range(len(tmp)):
    tmp = numpy.roll(tmp, 1)
    if ''.join(tmp) == t:
        print('Yes')
        break

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:
str_s = input()
str_t = input()

head = []

for i in range(len(str_s)):
    if(str_s[i] == str_t[0]):
        head.append(i)

for i in head:
    ans = ''
    ans = str_s[i:] + str_s[:i]
    if(ans == str_t):
        print('Yes')
        break
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
a =len(S)-1
i = len(S)-1
while i >0:
    if S == T:
        print('Yes')
        exit()
    else:
        S = S[a]+S[:a]        
        i-=1
print('No')

Submission status: Wrong Answer

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

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

for i in range(1,len(S)):
  if not S[0:i] in T:
    sep = i
    break
try:
  sep
except NameError:
  print("No")
  exit()

if S[sep:len(S)] in T[0:len(S)-4+1]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import numpy

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

if set(s) != set(t):
    print('No')

tmp = s[:]
for i in range(len(tmp)):
    tmp = numpy.roll(tmp, 1)
    if ''.join(tmp) == t:
        print('YES')
        break

Submission status: Wrong Answer

Solution code:
str_s = input()
str_t = input()

head = []

for i in range(len(str_s)):
    if(str_s[i] == str_t[0]):
        head.append(i)

for i in head:
    ans = str_s[i:] + str_s[:i]
    if(ans == str_t):
        print('Yes')
        break
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

for i in range(len(S)):
  if not S[0:i] in T:
    sep = i
    break
try:
  sep
except NameError:
  print("No")
  exit()
if S[sep:len(S)] in T[0:len(S)-4+1]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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


def rotation(s):
    for x in range(len(s)):
        s = s[-1] + s[:-1]
        if s == t:
            return "YES"
    return "NO"

print(rotation(s))

Submission status: Wrong Answer

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

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

for i in range(len(S)):
  if not S[0:i] in T:
    sep = i
try:
  sep
except NameError:
  print("No")
  exit()
if S[sep:len(S)] in T[0:len(S)-4+1]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
l = len(S)
ok = 1
noj = []
for i in range(l):
   if ok==0:
      break
   for j in range(l):
      if S[i]==T[j] and j not in noj:
         ok = 1
         noj+=[j]
         break
      ok = 0
if ok==1:
   print("Yes")
else:
   print("No")

Submission status: Wrong Answer

Solution code:
def main():
        run()

def run():
        word = input()
        word = list(word)
        target = input()
        isSame = False
        for _ in range(len(word)):
                word_string = "".join(word)
                print(word_string)
                if word_string == target:
                        isSame = True
                        break
                rotate_char = word.pop(0)
                word.append(rotate_char)
        if isSame:
                print("Yes")
        else:
                print("No")

if __name__ == "__main__":
        main()

Submission status: Wrong Answer

Solution code:
input_x = str(input())
input_y = str(input())
tmp = input_y
ary = list(input_y)
mongon = "Yes"
for c in input_x:
    idx = tmp.find(c)
    if idx == -1:
        mongon = "No"
        break
    else:
        ary.pop(idx)
        tmp = "".join(ary)
print(mongon)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time    : 2018/7/21 20:19
# @Version : 1.1
# @Author  : Jade
# @File    : acm.py
# @Software: PyCharm
#
s = input()
t = input()

if(s == t):
    print('Yes')
elif(len(s) != len(t)):
    print('No')
else:
    flag = True
    for i in range(len(s)-1):
        if(s[i:] + s[:i] == t):
            print('Yes')
            flag = False
            break
    if(flag):
        print('No')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
c = dict()
T2 = list(T)
for i in T2:
    c[i] = T2.count(i)
for i in S:
    if i in T2 and c[i] == S.count(i):
       f = True
    else:
        f = False
        break
if f:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

s = list(s)
t = list(t)
s.sort()
t.sort()

print(s)
print(t)

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

Submission status: Wrong Answer

Solution code:
c = raw_input().split()
d =raw_input().split()
 
 
a = list(c[0])
b = list(d[0])
 
 
size= len(a)
bsize = len(b)
 
numsum = 0
numsummax =0
 
for i in range(size): 
    for j in range(size): 
        
 
            
        if a[j] == b[(i+j)%size]: 
 
            numsum = numsum +1
            
        else:
            numsum = 0
            
        
    if numsummax<numsum:
            numsummax = numsum
 
if size == bsize and numsummax == size: 
    print "Yes" 
else: 
    print "No"

Submission status: Wrong Answer

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

s = list(s)
t = list(t)
s = s.sort()
t = t.sort()

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

Submission status: Wrong Answer

Solution code:
import sys

s = input()
t = input()

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

Submission status: Wrong Answer

Solution code:
input_x = str(input())
input_y = str(input())
mongon = "Yes"
for c in input_x:
    idx = input_y.find(c)

    if idx != -1:
        if idx == 0:
            input_y = input_y[idx + 1:]
        else:
            input_y = input_y[:idx - 1] + input_y[idx + 1:]
    else:
        mongon = "No"
        break

print(mongon)

Submission status: Wrong Answer

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

ans = 'No'

for i in range(len(s) - 1):
    if s != t:
        s = s[-1] + s[:-1]

    else:
        print('Yes')
        break

else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
s = list(S)
t = list(T)
flag = 0
s.sort()
t.sort()
for i in range(len(s)):
    if s[i] == t[i]:
        pass
    else:
        flag = 1
if flag == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

ans = 'No'

for i in range(len(s) - 1):
    if s != t:
        s = s[-1] + s[:-1]

    else:
        print('Yes')

else:
    print('No')

Submission status: Wrong Answer

Solution code:
c = raw_input().split()
d =raw_input().split()
 
 
a = list(c[0])
b = list(d[0])
 
 
size= len(a)
 
numsum = 0
numsummax =0
 
for i in range(size): 
    for j in range(size): 
        
 
            
        if a[j] == b[(i+j)%size]: 
 
            numsum = numsum +1
            
        else:
            numsum = 0
            
        
    if numsummax<numsum:
            numsummax = numsum
 
if numsummax == size: 
    print "Yes" 
else: 
    print "No"

Submission status: Wrong Answer

Solution code:
inp = [input() for _ in range(2)]
s = inp[0]
t = inp[1]

s = list(s)
t = list(t)
check = []
for i in t:
    if i in s:
        s[s.index(i)] = 0
    check.append(0)

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

Submission status: Wrong Answer

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

change = []
flag = 0
get = 0

for i in range(len(S)):
  if S[0] == T[i]:
    get = 1
    for j in range(len(S) - i):
      change.append(T[j+i])
    for k in range(i):
      change.append(T[k])
    for check in range(len(S)):
      if S[check] != change[check]:
        flag = 1
        break
      
if flag == 1:
  print("No")
else:
  if get == 1:
    print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
l = len(S)
ok = 1
for i in range(l):
   if ok==1:
      for j in range(l):
         if S[i]==T[j]:
            break
         elif j==l-1:
            ok = 0
            break
   else:
      break
if ok==1:
   print("Yes")
else:
   print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
ans=0
for i in range(0,len(s)):
    a=s[i:]
    b=s[:i]
    ss=a+b
    print(ss)
    if ss == t:
        ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:

def f(S):
    sets = {}
    for s in S:
        sets[s] = sets.setdefault(s, 0) + 1
    return sets
S = input()
T = input()
setS = f(S)
setT = f(T)

for k, v in setS.items():
    if setT.setdefault(k, 0) != v:
        print("No")
        break
else:
    N = len(S)
    for n in range(N):
        if S == T:
            print("Yes")
            break
        S = S[N-1] + S[0:N-1]
        print(S)
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
import sys

S = input()
T = input()

Sc = list(S)
Tc = list(T)

Sl = len(Sc)
newSc = Sc

for i in range(Sl):
    newSc = newSc[(Sl - 1):] + newSc[:(Sl - 1)]
    if Tc == newSc:
        print('yes')
        sys.exit()

print('No')

Submission status: Wrong Answer

Solution code:
c = raw_input().split()
d =raw_input().split()


a = list(c[0])
b = list(d[0])


size= len(a)

numsum = 0
numsummax =0

for i in range(size): 
    for j in range(size): 
        

            
        if a[j] == b[(i+j)%size]: 

            numsum = numsum +1
            
        else:
            numsum = 0
            
        
    if numsummax<numsum:
            numsummax = numsum

if numsummax == size: 
    print "yes" 
else: 
    print "no"

Submission status: Wrong Answer

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

change = []
flag = 0

for i in range(len(S)):
  if S[0] == T[i]:
    for j in range(len(S) - i):
      change.append(T[j+i])
    for k in range(i):
      change.append(T[k])
    for check in range(len(S)):
      if S[check] != change[check]:
        flag = 1
        break
      

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

Submission status: Wrong Answer

Solution code:
input_x = str(input())
input_y = str(input())
tmp = input_y
ary = list(input_y)
mongon = "Yes"
for c in input_x:
    if tmp.find(c) != -1:
        ary.pop(tmp.find(c))
        tmp = "".join(ary)
    else:
        mongon = "No"
        break

print(mongon)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

n = input()
m = input()

d = {}

flag = False

for i in range(len(n)):
    if n[i:] in m and n[i:] in m:
        flag = True
        
        
if flag:
    print("Yes")
else:
    print("No")