TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s=input()
ans=0
for i in range(1,3):
  if s[0]==s[i]:
    ans+=1

if ans==1:
  print('Yes')
else:
  print('No')


s=str(input())
l=[s[0],s[1],s[2],s[3]]
l.sort()
if l[0]==l[1] and l[2]==l[3] and l[0]!=l[2]:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
a = list(input())
a.sort()

if n[0] == n[1] and a[2]==a[3] and a[0]!==a[2]:
    print("Yes")

else:
    print("No")

a = list(input())
a.sort()

if n[0] == n[1] and a[2]==a[3] and a[0]!=a[2]:
    print("Yes")

else:
    print("No")



a = list(input())
a.sort()

if a[0] == a[1] and a[2]==a[3] and a[0]!=a[2]:
    print("Yes")

else:
    print("No")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
# -*- coding: utf-8 -*-

import sys
tmp = input()

print(tmp)
if (tmp[0] == tmp[1]) and (tmp[2] == tmp[3]) and (tmp[1] != tmp[3]):
	print("Yes")
	sys.exit()
if (tmp[0] == tmp[2]) and (tmp[1] == tmp[3]) and (tmp[2] != tmp[3]):
	print("Yes")
	sys.exit()
if (tmp[0] == tmp[3]) and (tmp[2] == tmp[1]) and (tmp[1] != tmp[3]):
	print("Yes")
	sys.exit()
print("No")



# -*- coding: utf-8 -*-

import sys
tmp = input()

print(tmp)
if (tmp[0] == tmp[1]) and (tmp[2] == tmp[3]) and (tmp[1] != tmp[3]):
	print("Yes")
	sys.exit()
if (tmp[0] == tmp[2]) and (tmp[1] == tmp[3]) and (tmp[2] != tmp[3]):
	print("Yes")
	sys.exit()
if (tmp[0] == tmp[3]) and (tmp[2] == tmp[1]) and (tmp[1] != tmp[3]):
	print("Yes")
	sys.exit()
print("No")



# -*- coding: utf-8 -*-

import sys
tmp = input()

if (tmp[0] == tmp[1]) and (tmp[2] == tmp[3]) and (tmp[1] != tmp[3]):
	print("Yes")
	sys.exit()
if (tmp[0] == tmp[2]) and (tmp[1] == tmp[3]) and (tmp[2] != tmp[3]):
	print("Yes")
	sys.exit()
if (tmp[0] == tmp[3]) and (tmp[2] == tmp[1]) and (tmp[1] != tmp[3]):
	print("Yes")
	sys.exit()
print("No")



Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
#coding:utf-8
N = int(input())
D = list(map(int,input().split()))
D = sorted(D)
idx = len(D) // 2
print(D[idx] - D[idx-1])

#coding:utf-8
from collections import Counter

S = input()
cnt = Counter(list(S))
ls = list(cnt.values())
if (ls[0]==2 and ls[1]==2):
    print ("Yes")
else:
    print ("No")



Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s=input()
a=sorted(s)
print(a)
if a[0]==a[1] and a[2]==a[3]:
    print("Yes")
else:
    print("No")

s=input()
a=sorted(s)
if a[0]==a[1] and a[2]==a[3] and a[1]!=a[2]:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
from math import factorial

def count_pattern(n, r):
    if r == 0:
        return 1
    else:
        a = factorial(n) // factorial(r) // factorial(n - r)
    return int(a)

n, k = map(int, input().split())

for i in range(k):
    pick_count = i + 1

    blue_pattern =  count_pattern(k - 1, pick_count - 1)
    red_pattern = count_pattern(n - k + 1 , pick_count)
    total_pattern = blue_pattern * red_pattern
    print (int(total_pattern % (10 ** 9 + 7)))


import sys
import collections

input = sorted(sys.argv[1])
a = collections.Counter(input)
if len(a) == 2 and a.most_common()[0][1] == 2:
    print('Yes')
else:
    print('No')

import collections

inputstr = input()
input = sorted(inputstr)
a = collections.Counter(input)
if len(a) == 2 and a.most_common()[0][1] == 2:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = list(str(input()))

print(S)

s = set(S)
if len(s) == 2:
    count = 0
    for _ in s:
        if len([a for a in S if a == _]) == 2:
            print('Yes')
            quit()

print('No')

S = list(str(input()))

s = set(S)
if len(s) == 2:
    count = 0
    for _ in s:
        if len([a for a in S if a == _]) == 2:
            print('Yes')
            quit()

print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S=input()
if S[0]==S[1] and S[2]==S[3] and S[0]!=S[2]:
  print(Yes)
elif S[0]==S[2] and S[1]==S[3] and S[0]!=S[1]:
  print(Yes)
elif S[0]==S[3] and S[1]==S[2] and S[0]!=S[1]:
  print(Yes)
else:
  print(No)

S=input()
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print(Yes)
elif S[0] == S[2] and S[1] == S[3] and S[0] != S[1]:
    print(Yes)
elif S[0] == S[3] and S[1] == S[2] and S[0] != S[1]:
    print(Yes)
else:
    print(No)

S=input()
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print('Yes')
elif S[0] == S[2] and S[1] == S[3] and S[0] != S[1]:
    print('Yes')
elif S[0] == S[3] and S[1] == S[2] and S[0] != S[1]:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):

N, K = map(int, input().split())
mod = 10**9 + 7
a = N - K + 1
print(a)
for i in range(K-1):
    a = (a * (N - K - i) * (K - (i + 1)) // ((i+2) * (i+1))) % mod
    print(a)




N, K = map(int, input().split())
mod = 10**9 + 7
a = N - K + 1
print(a)
for i in range(K-1):
    a = a * (N - K - i) * (K - (i + 1)) // ((i+2) * (i+1)) % mod
    print(a)




N, K = map(int, input().split())
mod = 10**9 + 7
a = N - K + 1
print(a)
for i in range(K-1):
    a = a * (N - K - i) * (K - (i + 1)) // ((i+2) * (i+1))
    a %= mod
    print(a)



from collections import defaultdict
S = input()
D = defaultdict(int)
for s in S:
    D[s] += 1

def main(D):
    if len(D.keys()) != 2:
        return 0
    else:
        for v in D.values():
            if v != 2:
                return 0
    return 1

if main(D):
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S=input()
s=list(S)
if s[1]==s[2] and s[3]==s[4] and s[2]!=s[3]:
	print("Yes")
elif s[1]==s[3] and s[2]==s[4] and s[1]!=s[3]:
	print("Yes")
elif s[1]==s[4] and s[2]==s[3] and s[1]!=s[2]:
	print("Yes")
else:
	print("No")

S=input()
s=list(S)
if s[0]==s[1] and s[2]==s[3] and s[0]!=s[2]:
	print("Yes")
elif s[0]==s[2] and s[1]==s[3] and s[0]!=s[1]:
	print("Yes")
elif s[0]==s[3] and s[1]==s[2] and s[0]!=s[1]:
	print("Yes")
else:
	print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
cnt = 0
for i in renge(4 - 1) :
  if s[i] != s[i + 1] :
    cnt += 1
if cnt != 0 && cnt <= 2 :
  print("Yes")
else :
  print("No")


s = input()
s = sorted(s)
cnt = 0
for i in range(4 - 1) :
  if s[i] != s[i + 1] :
    cnt += 1
if cnt == 1 :
  print("Yes")
else :
  print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
ans = False
if s[0] == s[1] :
  if s[0] != s[2] and s[2] ==s[3] :
    ans = True
elif s[0] == s[2] :
  if s[0] != s[1] and s[1] ==s[3] :
    ans = True
else s[0] == s[3] :
  if s[0] != s[1] and s[2] ==s[1] :
    ans = True
if ans :
  print('Yse')
else:
  print('No')

s = input()
ans = False
if s[0] == s[1] and s[2] == s[3] :
  ans = True
if s[0] == s[2] and s[1] == s[3] :
  ans = True
if s[0] == s[3] and s[0] == s[2] :
  ans = True
if ans :
  print('Yse')
else:
  print('No')

s = input()
ans = Felse
if s[0] == s[1] and s[2] == s[3] :
  ans = True
if s[0] == s[2] and s[1] == s[3] :
  ans = True
if s[0] == s[3] and s[0] == s[2] :
  ans = True
if ans :
  print('Yse')
else:
  print('No')

s = input()
ans = False
if s[0] == s[1] :
  if s[0] != s[2] and s[2] == s[3] :
    ans = True
elif s[0] == s[2] :
  if s[0] != s[1] and s[1] == s[3] :
    ans = True
elif s[0] == s[3] :
  if s[0] != s[1] and s[1] == s[2] :
    ans = True
if ans :
  print('Yse')
else:
  print('No')


s = input()
ans = False
if s[0] == s[1] :
  if s[0] != s[2] and s[2] ==s[3] :
  ans = True
elif s[0] == s[2] :
  if s[0] != s[1] and s[1] ==s[3] :
  ans = True
else s[0] == s[3] :
  if s[0] != s[1] and s[2] ==s[1] :
  ans = True
if ans :
  print('Yse')
else:
  print('No')

s = input()
ans = False
if s[0] == s[1] and s[2] == s[3] :
  ans = True
if s[0] == s[2] and s[1] == s[3] :
  ans = True
if s[0] == s[3] and s[1] == s[2] :
  ans = True
if ans :
  print('Yse')
else:
  print('No')

S = input()
 
if len(set(S)) == 2:
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = sorted(list(input()))
if s[0] == s[1] and s[2] == s[3]:
    print('Yes')
elif s[0] == s[1] and s[0] == s[2]
    print('No')
else:
    print('No')

s = sorted(list(input()))
if s[0] == s[1] == s[2] == s[3]:
    print('No')
elif s[0] == s[1] and s[2] == s[3]:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()

if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
    print('yes')
elif s[0] == s[2] and s[1] == s[3] and s[0] != s[1]:
    print('yes')
elif s[0] == s[3] and s[1] == s[2] and s[0] != s[1]:
    print('yes')
else:
    print('NO')

s = input()

if len(set(s)) == 2 and s.count(s[0]) ==2:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s=input()
if s[0]==s[1] and s[2]==s[3] and s[0]!=s[2]:
  print("yes")
elif s[0]==s[2] and s[1]==s[3] and s[0]!=s[1]:
  print("yes")
elif s[0]==s[3] and s[1]==s[2] and s[0]!=s[1]:
  print("yes")
else:
  print("no")


s=input()
if s[1]==s[2] and s[3]==s[4]:
    print("yes")
    elif s[1]==s[3] and s[2]==s[4]:
        print("yes")
    elif s[1]==s[4] and s[2]==s[3]:
        print("yes") 
else:
    print("no")

s=input()
if s[0]==s[1] and s[2]==s[3] and s[0]!=s[2]:
  print("Yes")
elif s[0]==s[2] and s[1]==s[3] and s[0]!=s[1]:
  print("Yes")
elif s[0]==s[3] and s[1]==s[2] and s[0]!=s[1]:
  print("Yes")
else:
  print("No")


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = sorted(list(input()))
if s[0]==s[1] and s[1]!=s[2] and s[2]==[3]: print("Yes")
else: print("No")

s = sorted(list(input()))
if s[0]==s[1] and s[1]!=s[2] and s[2]==s[3]: print("Yes")
else: print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
import sys
s = input()
a = s[0]
if s.count(a) != 2:
  print("No")
  sys.exit()
s.replace(a)
b = s[0]
if s.count(b) != 2:
  print("No")
  sys.exit()
print("Yes")


s = input()
a = s[0]
if s.count(a) != 2:
  print("No")
  sys.exit()
s.remove(a)
s.remove(a)
b = s[0]
if s.count(b) != 2:
  print("No")
  sys.exit()
print("Yes")

import sys
s = input()
a = s[0]
if s.count(a) != 2:
  print("No")
  sys.exit()
s.replace(a,"")

if s[0] != s[1]:
  print("No")
else:
  print("Yes")


import sys
s = input()
a = s[0]
if s.count(a) != 2:
  print("No")
  sys.exit()
t = s.replace(a,"")

if t[0] != t[1]:
  print("No")
else:
  print("Yes")


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
ans = []
for i in range(4):
    ans.append(s[i])

ans.sort()
print('Yes' if ans[0] == ans[1] and ans[2] == ans[3] ans ans[0] != ans[2] else 'No')

s = input()
ans = []
for i in range(4):
    ans.append(s[i])

ans.sort()
print('Yes' if ans[0] == ans[1] and ans[2] == ans[3] and ans[0] != ans[2] else 'No')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
import collections
S = input()

c = collections.Counter(S)
values, counts = zip(*c.most_common())

if counts == (2, 2):
    print("YES")
else:
    print("NO")
    

import collections
S = input()

c = collections.Counter(S)
values, counts = zip(*c.most_common())

if counts == (2, 2):
    print("Yes")
else:
    print("No")
    

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
b_list = list(input())
b_list = sorted(b_list)
"""
if b_list[0] == b_list[1] and  b_list[2] == b_list[3]:
    print("Yes")
else:
    print("No")
    """
print("No")

b_list = list(str(input()))
b_list = sorted(b_list)

if b_list[0] == b_list[1] and b_list[1] == b_list[2]:
    print("No")
elif b_list[0] == b_list[1] and  b_list[2] == b_list[3]:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
l=[i for i in input()]

ans='No'

con=len(unique(l))
if (con==2) and (l.count(l[0])==2):
  ans='Yes'

print(ans)

l=[i for i in input()]

ans='No'

con=len(set(l))
if (con==2) and (l.count(l[0])==2):
  ans='Yes'

print(ans)

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s=sorted(input())
print("Yes" if s[0]==s[1] and s[2]==s[3] and s[0]!==s[2] else "No")

s=sorted(input())
print("Yes" if s[0]==s[1] and s[2]==s[3 else "No"])


s=sorted(input())
print("Yes" if s[0]==s[1] and s[2]==s[3] and s[0]!=s[2] else "No")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
listS = list(s)
sortS = listS.sort()

if listS[0] == listS[1] and listS[2] == listS[3]:
  if listS[0] != listS[2]
  	print('Yes')
else:
  print('No')


s = input()
listS = list(s)
sortS = listS.sort()
if listS[0] == listS[1] and listS[2] == listS[3]:
  if listS[0] != listS[3]:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = list(input())
if s[0] == s[1] and s[2] == s[3] and s[0] !== s[2]:
  print("Yes")
else:
  print("No")

s = list(input())
s.sort()
if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S=str(input())
a=0
for i in S:
  if S.count(i)==2:
    a+=2
    
print('Yes' if a==4 else 'No')

S=str(input())
L=[]
for i in range(4):
  L.append(S[i])
L.sort()
 
print('Yes' if L[0]==S[1] and L[2]==L[3] else 'No')

S=str(input())
L=[]
for S in range(4):
  L.append(S)
L.sort()

print('Yes' if L[0]==S[1] and S[2]==S[3] else 'No')

S=str(input())
L=[]
for i in range(4):
  L.append(S[i])
L.sort()
 
print('Yes' if L[0]==S[1] and L[2]==L[3] and L[0]!=L[2] else 'No')

S=str(input())
a=0
for i in S:
  if S.count(i)==2:
    a+=1
    
print('Yes' if a==4 else 'No')

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()

if s.count(s[0]) == 2 and s.count(s[1])==2 and s.count(as2])==2:
    print("Yes")
else:
    print("No")

s = input()

if s.count(a[0]) == 2 and s.count(a[1])==2 and s.count(a[2])==2:
    print("Yes")
else:
    print("No")

s = input()

if s.count(a[0]) == 2 and a.count(a[1])==2 and a.count(a[2])==2:
    print("Yes")
else:
    print("No")

s = input()

if s.count(s[0]) == 2 and s.count(s[1])==2 and s.count(s[2])==2:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
a=list(input())
b=set(a)
count=0
for i in range(4):
  if a[0]==a[i]:
    count+=1
if len(b)==0 and (count==2):
  print('Yes')
else:
  print('No')



a=list(input())
b=set(a)
count=0
for i in range(4):
  if a[0]==a[i]:
    count+=1
if len(b)==2 and (count==2):
  print('Yes')
else:
  print('No')


Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = list(input())

a = sorted(s)

print(a)

if a[0] == a[1] and a[2] == a[3] and a[0] != a[2]:
    print('Yes')
else:
    print('No')

s = list(input())

a = sorted(s)

if a[0] == a[1] and a[2] == a[3] and a[0] != a[2]:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
a = input()
b = sorted(a)

if b[0]==b[1] and b[2]==b[3]:
  print("YES")
else:
  print("NO")

S = sorted(input())

if S.count(S[0])==2 and S.count(S[2])==2:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
n, k =map(int, input().split())
mod = 10 ** 9 + 7
def com(a, b):
  b = min(b, a-b)
  sum = 1
  for i in range(a-b+1, a+1):
    sum *= i
  for j in range(1, b+1):
    sum //= j
  return sum % mod
for i in range(1, k+1):
  ans = com(n-k+1, i) * com(k-1, i-1) % mod
  print(ans)

s = str(input())
letter_list = []
for letter in s:
    letter_list.append(letter)
letter_list.sort()
l1 = letter_list[0]
l2 = letter_list[2]
if letter_list.count(l1) == 2 and letter_list.count(l2) == 2:
    print('Yes')
else:
    print('No')


Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
f = 1 
if (s[0] == s[1] and s[2] == s[3] and s[1] != s[2]) or ((s[:2] == s[2:] or s[1::-1] == s[2:]) and s[1] != s[2]):
        f = 0 
print('YNeos'[f::2])

s = input()
f = 1 
if s[0] == s[1] == s[2] == s[3]:
        f = 1 
elif (s[0] == s[1] and s[2] == s[3]) or (s[:2] == s[2:] or s[1::-1] == s[2:]):
        f = 0 
print('YNeos'[f::2])

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
import collections
S = input()
c = collections.Counter(S)

if (len(c.keys()) == 2 )and(c.values() == [2,2]):
  print("Yes")
else:
  print("No")

import collections
S = input()
c = collections.Counter(S)
 

if (len(c.keys()) == 2 )and(list(c.values()) == [2,2]):
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()

orgin = set(list(s))

if len(orgin) > 2:
    print("No")
    exit()

a=0
b=0
for i in s:
    if i == origin[0]: a+=1
    elif i == origin[1]: b+=1

if a==2:
    print("Yes")
else:
    print("No")

s = input()

origin = list(set(list(s)))

if len(origin) > 2:
    print("No")
    exit()
a=0
b=0
for i in s:
    if i == origin[0]: a+=1
    elif i == origin[1]: b+=1

if a==2:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
def code_for_A(S, test=None):

    if not test:
        S = input()

    condition = 0
    for s in S:
        condition += S.count(s) != 2

    if condition:
        answer = 'No'
    else:
        answer = 'Yes'

    print(answer)

code_for_A(,1)

def code_for_A(S, test=None):

    if not test:
        S = input()

    condition = 0
    for s in S:
        condition += S.count(s) != 2

    if condition:
        answer = 'No'
    else:
        answer = 'Yes'

    print(answer)

code_for_A(None, 0)

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s=input()
t=set(s)
if len(t)==2:
  cnt1=0
  cnt2=0
  for i in s:
    if i==t[0]:
      cnt1+=1
      
    elif i==t[1]:
      cnt2+=1
      
  if cnt1==2 and cnt2==2:
    print('Yes')
    exit()
    
print('No')
    
  

s=input()
t=list(set(s))
if len(t)==2:
  cnt1=0
  cnt2=0
  for i in s:
    if i==t[0]:
      cnt1+=1
      
    elif i==t[1]:
      cnt2+=1
      
  if cnt1==2 and cnt2==2:
    print('Yes')
    exit()
    
print('No')
    

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = input()

s = []
a = 0
count = 0

for i in range(0, len(S)):
    s.append(S[i])

for i in range(0, len(s)):
    if a == s[i]:
        print('Bad')
    else:
        a = s[i]
        count += 1

if count == 4:
    print('Good')

S = input()

s = []
count = 0

for i in range(0, len(S)):
    s.append(S[i])

s = sorted(s)

a = s[0]
b = s[2]

for i in range(0, len(s)):
    if a == s[i] or b == s[i]:
        count += 1

if s[0] == s[2]:
    print('No')
elif count == 4:
    print('Yes')
else:
    print('No')


Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = input()
cnt = 0
for i in range(len(S)-1):
    for j in range(1, len(S)):
        if S[i] == S[j]:
            cnt += 1

if cnt == 2:
    print("Yes")

else:
    print("No")

S = input()
cnt = 0
for i in range(len(S)-1):
    for j in range(i+1, len(S)):
        if S[i] == S[j]:
            cnt += 1

if cnt == 2:
    print("Yes")

else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
cmp = s[0]
cnt = 0
for i in range(1, len(s)):
    if s[i] == cmp:
        cnt += 1
    else:
        cnt -= 1
if cnt == 0:
    print('Yes')
else:
    print('No')


s = input()
s.sort()
if s[0] == s[1] and s[2] == s[3]:
    print('Yes')
else:
    print('No')


s = input()
cmp = s[0]
cnt = 0
for i in range(1, n):
    if s[i] == cmp:
        cnt += 1
    else:
        cnt -= 1
if cnt == 0:
    print('Yes')
else:
    print('No')


s = list(input())
s.sort()
if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
    print('Yes')
else:
    print('No')


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
check = True

if len(set(list(s))) == len(s):
    pass
else:
    for c in list(set(list(s))):
        if list(s).count(c) != 2:
            if check:
                print('No')
                check = False
    if check:
        print('Yes')

s = input()

check = True
 
if len(set(list(s))) == len(s):
  print('No')
else:
    for c in list(set(list(s))):
        if list(s).count(c) != 2:
            if check:
                print('No')
                check = False
    if check:
        print('Yes')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
for i in s:
  if s.counter(i) != 2:
    print('No')
    exit()
print('Yes')

s = input()
for i in s:
  if s.count(i) != 2:
    print('No')
    exit()
print('Yes')


Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
a = list(map(str,input()))
if a[0] = a[1] and a[2] = a[3] and a[0] != a[2]:
    print("Yes")
elif a[0] = a[3] and a[1] = a[2] and a[0] != a[1]:
    print("Yes")
elif a[0] = a[2] and a[1] = a[3] and a[0] != a[1]:
    print("Yes")
else:
    print("No")
  
    
    
        
    

a = list(map(str,input()))
if a[0] == a[1] and a[2] == a[3] and a[0] != a[2]:
    print("Yes")
elif a[0] == a[3] and a[1] == a[2] and a[0] != a[1]:
    print("Yes")
elif a[0] == a[2] and a[1] == a[3] and a[0] != a[1]:
    print("Yes")
else:
    print("No")
  

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
#coding:utf-8
from math import factorial

N, K = map(int, input().split())
# subli = []


def P(n,r):
    return factorial(n) // factorial(n-r)

def C(n,r):
    return P(n,r) // factorial(r)


for i in range(1, K+1):
    '''
    n = N - K + i
    ans = math.factorial(n) // (math.factorial(N-K) * math.factorial(i))
    '''
    ans = C(N-K+1, i) * C(K-1, i-1)
    print(ans % (10**9 + 7))

#coding:utf-8

S = list(input())

S.sort()

if S[0] == S[1] and S[2] == S[3]:
    if S[0] == S[1] == S[2] == S[3]:
        print('No')
    else:
        print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
def main():
    import sys
    input = sys.stdin.readline
    
    a = sorted(input())
    if a[0] == a[1] and a[2] == a[3] and a[1] != a[2]:
        print("Yes")
    else:
        print("No")
    
    return 0

main()

def main():
    import sys
    input = sys.stdin.readline
    
    a = sorted(input()[:-1])
    # print(a)
    if a[0] == a[1] and a[2] == a[3] and a[1] != a[2]:
        print("Yes")
    else:
        print("No")
    
    return 0

main()

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
input_ = input()

input_str = set(input_)

input_str_arr = [s for s in input_str]

if input_.count(inpute_str_arr[0]) and input_.count(inpute_str_arr[0]):
  print("Yes")
else:
  print("No")


num_input = int(input())
input_arr = [int(x) for x in input().split()]

max_input = max(input_arr)
count = 0
second_arr =[]
first_arr = []
sorted_arr = sorted(input_arr)
ans = sorted_arr[int(num_input/2)] - sorted_arr[int(num_input/2)-1]
print(ans)

input_ = input()

input_str = set(input_)

input_str_arr = [s for s in input_str]

if len(set(input_str_arr))==2:
    consunt()
else:
    print("No")
    

def consunt():
    if input_.count(input_str_arr[0]) and input_.count(input_str_arr[1]):
      print("Yes")
    else:
      print("No")

def consunt():
    if input_.count(input_str_arr[0]) and input_.count(input_str_arr[1]):
      print("Yes")
    else:
      print("No")

input_ = input()

input_str = set(input_)

input_str_arr = [s for s in input_str]

if len(set(input_str_arr))==2:
    consunt()
else:
    print("No")

    


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s=input()
s.sort()
if s[0]==s[1]and s[2]==s[3]:
  print("Yes")
else:
  print("No")

s=input()
asdf=True
deta=tuple(s)
if len(data)==2:
  print("No")
else:
  if s.count(data[0])==2:
    print("Yes")
  else:
    print("No")


s=input()
ss=[s[0],s[1],s[2],s[3]]
ss.sort()
print(ss)
if ss[0]==ss[1]and ss[2]==ss[3]:
  print("Yes")
else:
  print("No")

n=int(input())
p=list(map(int,input().split()))
uuum = 0
for i in range(n-2):
  aaa = [p[i],p[i+1],p[i+2]]
  aaa.sort()
  if aaa[1]==p[i+1]:
    uuum+=1
print(uuum)


s = ''.join(sorted(input()))
if(s[0]==s[1] and s[2] == s[3] and s[1] != s[3]):
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()

if (( s[0]==s[1] and s[2]==s[3] ) or ( s[1]==s[2] and s[0]==s[3] ) 
   or ( s[0]==s[2] and s[1]==s[3] )) :

    if ( s[0]==s[1] and s[1]==s[2] and s[2]==s[3] ) :

        print('Bad')

    else :

        print('Good')
        
else :
    print('Bad')


s = input()

if (( s[0]==s[1] and s[2]==s[3] ) or ( s[1]==s[2] and s[0]==s[3] ) 
   or ( s[0]==s[2] and s[1]==s[3] )) :

    if ( s[0]==s[1] and s[1]==s[2] and s[2]==s[3] ) :

        print('No')

    else :

        print('Yes')
        
else :
    print('No')


Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
import sys
input = sys.stdin.readline
#-------------------------------------
import collections

s = list(input())

c = collections.Counter(s)

if len(c.keys()) == 2 and c.most_common()[0][1] == 2 and c.most_common()[1][1] == 2:
        print("Yes")
else:
        print("No")

import sys
input = sys.stdin.readline
#-------------------------------------
s = list(input())
s.sort()
if s[0] is s[1] and s[2] is s[3] and s[1] is not s[2]:
        print("Yes")
else:
        print("No")

import sys
input = sys.stdin.readline
#-------------------------------------
import collections

s = list(input())

c = collections.Counter(s)
print(c)

if len(c.keys()) == 2 and c.most_common()[0][1] == 2 and c.most_common()[1][1] == 2:
        print("Yes")
else:
        print("No")

import sys
input = sys.stdin.readline
#-------------------------------------
s = list(input())
s.sort()
if s[0] == s[1] and s[2] == s[3] and s[1] != s[2]:
        print("Yes")
else:
        print("No")

import sys
def input(): return sys.stdin.readline().strip()
#-------------------------------------
import collections
s = list(input())
c = collections.Counter(s)
if len(c.keys()) == 2 and c.most_common()[0][1] == 2:
        print("Yes")
else:
        print("No")


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s=input()
import colletions
s=dict(collections.Counter(s))
if len(s)==2:
  flag=True
  for k in s.values():
    if k!=2:
      flag=False
  if flag:
    print("Yes")
  else:
    print("No")
else:
  print("No")
  

s=input()
import collections
s=dict(collections.Counter(s))
if len(s)==2:
  flag=True
  for k in s.values():
    if k!=2:
      flag=False
  if flag:
    print("Yes")
  else:
    print("No")
else:
  print("No")
  


Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
import sys
string = sys.stdin.readline()

if all([string.count(c)==2 for c in set(string)]) :
    print('Yes')
else:
    print('No')

import sys
string = sys.stdin.readline()

from collections import defaultdict
d = defaultdict(int)
for c in string:
    d[c] += 1

d = list(d.values())
if len(d) == 2 and d[0] == 2 and d[1] == 2:
    print('Yes')
else:
    print('No')

import sys
string = sys.stdin.readline()

from collections import defaultdict
d = defaultdict(int)
for c in string:
    d[c] += 1
    
if list(d.values()) == [2, 2] :
    print('Yes')
else:
    print('No')

import sys
string = sys.stdin.readline()

from collections import defaultdict
d = defaultdict(int)
for c in string:
    d[c] += 1

d = list(d.values())
if len(d) == 2 and d[0] == 2:
    print('Yes')
else:
    print('No')


string = input()

if all([string.count(c)==2 for c in set(string)]) :
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S=input()

from collections import Counter

c=Counter([S[0],S[1],S[2],S[3]])

if len(list(c.keys()))==2:
    flag=True
    for key in c.keys():
        if c[key]!=2:
            flag=False:
            break

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

S=input()

from collections import Counter

c=Counter([S[0],S[1],S[2],S[3]])

if len(list(c.keys()))==2:
    flag=True
    for key in c.keys():
        if c[key]!=2:
            flag=False
            break

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

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
text = input()

text1 = text.strip(text[0])
text2 = text1.strip(text[0])

if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
  print("Yes")
else:
  print("No")

text = list(input())

list = {}

for t in text:
  if text.count(t) != 2:
    continue
  if t in list:
    list[t] += 1
  else:
    list[t] == 1
    
if len(list) == 2:
  return Yes
else:
  return No

text = input()

text1 = text.strip(text[0])
text2 = text.strip(text[0])

if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
  print("Yes")
else:
  print("No")

text = input()

if len(text) == 4:
	text = text.strip(text[0])
	if len(text) == 2:  
		text = text.strip(text[0])
		if len(text) == 0:
  			print("Yes")
		else:
  			print("No")
	else:
      print("No")
else:
 	print("No")


text = input()

text1 = text.replace(text[0], "")
try:
	text2 = text1.replace(text1[0], "")
except:
	text2 = "e"

if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
  print("Yes")
else:
  print("No")


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = str(input())

if s[0] == s[1]:
    if s[2] == s[3] and s[0] != s[2]:
        print('Yes')
    else:
        print('No')
elif s[0] == s[2]:
    if s[1] == s[3] and s[0] != s[1]:
        print('Yes')
    else:
        print('No')
elif s[0] == s[3]:
    if s[1] == s[2] and s[0] != s[1]:
        print('Yes')
        else:
        print('No')
else:
    print('No')

s = str(input())

if s[0] == s[1]:
    if s[2] == s[3] and s[0] != s[2]:
        print('Yes')
    else:
        print('No')
elif s[0] == s[2]:
    if s[1] == s[3] and s[0] != s[1]:
        print('Yes')
    else:
        print('No')
elif s[0] == s[3]:
    if s[1] == s[2] and s[0] != s[1]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
a = list(input())
a.sort()
b = False
c = False
if a[0] == a[1]:
    b = True

if a[2] == a[3]:
    c = True
print(b and c)    

a = list(input())
a.sort()
b = False
c = False
if a[0] == a[1]:
    b = True
if a[2] == a[3]:
    if a[2] != a[0]:
        c = True
print(b and c)    

a = list(input())
a.sort()
b = "No"
if a[0] == a[1]:
    if a[2] == a[3]:
        if a[2] != a[0]:
            b = "Yes"
print(b)    

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
from collections import Counter
A=input()
ele=Counter(A)
print("YES" if len(ele)==2 else "NO")

from collections import Counter
A=input()
ele=Counter(A)
print("Yes" if len(ele)==2 else "No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
s.sort()
ans = "No"
if s[0] == s[1] and s[2] == s[3]:
    if s[1] != s[2]:
        ans = "Yes"
print(ans)


s = list(input())
s.sort()
ans = "No"
if s[0] == s[1] and s[2] == s[3]:
    if s[1] != s[2]:
        ans = "Yes"
print(ans)


Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
def comb(n, r):
  if n < 0 or r < 0:
    return 0
  r = min(r, n - r)
  if n == 0 or r == 0:
    return 1
  return (n - r + 1) * comb(n, r - 1) // r

N, K = list(map(int, input().split()))
for i in range(K):
  print(comb(N - K + 1, i + 1) * comb(K - 1, i) % (10 ** 9 + 7))

S = input()
if len(set(S)) != 2 or S.count(S[0]) != 2:
  print('No')
  exit()
print('Yes')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
from collections import Counter

# list(map(int, input().split()))
s = list(input())
v = s[0]
c = Counter(s)
if len(c) == 2 and c[v] == 2:
    print("YES")
else:
    print("NO")



from collections import Counter

# list(map(int, input().split()))
s = list(input())
v = s[0]
c = Counter(s)
if len(c) == 2 and c[v] == 2:
    print("Yes")
else:
    print("No")



Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
s = sorted(s)

if s[0] != s[1] or s[2] != s[3] or s[0] != s[3]:
    print('No')
else:
    print('Yes')


s = input()
s = sorted(s)

if s[0] != s[1] or s[2] != s[3] or s[0] != s[3] or s[1] != s[3]:
    print('No')
else:
    print('Yes')


s = input()
s = sorted(s)

if s[0] != s[1] or s[2] != s[3] or s[0] == s[3]:
    print('No')
else:
    print('Yes')


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
input_data=input()

a=input_data[0]
b=input_data[1]
c=input_data[2]
d=input_data[3]

if a==b :
    if c==d and a!=c :
            output="yes"
    else :
        output="no"
    
else :
        if a==c and b==d :
            output="yes"
    
        elif a==d and b==c :
            output="yes"
        
        else :
            output="no"
           
print(output)

n=input()
ps=input()

n=int(n[0])
ps=ps.split()
ps=[int(ps) for ps in ps]

output=0
for i in range(n-2):
    if ps[i]<ps[i+1] and ps[i+1]<ps[i+2]:
        output=output+1
    elif ps[i+2]<ps[i+1] and ps[i+1]<ps[i]:
        output=output+1
    else:output=output+0
    
print(output)

input_datainput()

a=input_data[0]
b=input_data[1]
c=input_data[2]
d=input_data[3]

if a==b :
    if c==d and a!=c :
            output="yes"
    
else :
        if a==c and b==d :
            output="yes"
    
        elif a==d and b==c :
            output="yes"
        
        else :
            output="no"
        
print(output)

n=input()
p=input()

n=int(n[0])
p=p.split()
p=[int(p) for p in p]

output=0
for i in range(n-2):
    if p[i]<p[i+1] and p[i+1]<p[i+2]:
        output=output+1
    elif p[i+2]<p[i+1] and p[i+1]<p[i]:
        output=output+1
    else:
        output=output+0
    
print(output)

input_data=input()
 
a=input_data[0]
b=input_data[1]
c=input_data[2]
d=input_data[3]
 
if a==b :
    if c==d and a!=c :
            output="Yes"
    else :
        output="No"
    
else :
        if a==c and b==d :
            output="Yes"
    
        elif a==d and b==c :
            output="Yes"
        
        else :
            output="No"
           
print(output)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
d = {}
for ss in s:
    d[ss] = d.get(ss, 0) + 1

print("Yes" if len(d) == 2 and d.items()[0][1] == 2 else "No")

s = input()
d = {}
for ss in s:
    d[ss] = d.get(ss, 0) + 1

print("Yes" if len(d) == 2 and list(d.items())[0][1] == 2 else "No")

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = list(input())
s.sort()
print(s)
ans = "Yes" if s[0] == s[1] and s[2] == s[3] and s[0] != s[2] else "No"
print(ans)

s = list(input())
s.sort()
ans = "Yes" if s[0] == s[1] and s[2] == s[3] and s[0] != s[2] else "No"
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = input()
if S.count(S[0])==2 and S.count(S[1])==2 and S.count(S[2])==2:
  print('Yes')
print('No')

S = input()
if S.count(S[0])==2 and S.count(S[1])==2 and S.count(S[2])==2:
  print('Yes')
else:
  print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
word=input()
word=sorted(word)
print(word)
if word[0]==word[1] and word[2]==word[3] and word[0]!=word[2]:
    print('Yes')
else:
    print('No')


s=input()
a={}
for i in s:
    if i not in a:
        a[i]=1
    else:
        a[i]+=1
count=0

if len(a)==2:
    for i in a:
        if a[i]==2:
            pass
        else:
            count+=1
    if count == 0:
        print("Yes")
    else:
        print("No")
else:
    print("No"

S=input()
S1=''.join(sorted(S))
S=str(S1)
if S[0]==S[1] and S[1]!=S[2] and S[2]==S[3]:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
v = [int(n) for n in input()];s = [n for n in input()];r = (s[0] == s[1] and s[2] == s[3]) or (s[0] == s[2] and s[1] == s[3]) or (s[0] == s[3] and s[1] == s[2]);print("Yes" if r else "No")


v = [n for n in input()];s = [n for n in input()];r = (s[0] == s[1] and s[2] == s[3]) or (s[0] == s[2] and s[1] == s[3]) or (s[0] == s[3] and s[1] == s[2]);print("Yes" if r else "No")


s = [n for n in input()];r = len(set(s)) == 2 and ((s[0] == s[1] and s[2] == s[3]) or (s[0] == s[2] and s[1] == s[3]) or (s[0] == s[3] and s[1] == s[2]));print("Yes" if r else "No")


Verdicts: Runtime Error

Runtime Error

Accepted