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):
n = input()
p = input().split()


n = int(n)

cnt=0

for i in range(1,n-1):
  if(p[i]<p[i+1] and p[i]>p[i-1]) or (p[i]>p[i+1] and p[i]<p[i-1]):
    cnt+=1;

  
print(cnt)

n = input()
p = input().split()


n = int(n)

cnt=0

for i in range(1,n-1):
  if(p[i]<p[i+1] and p[i]>p[i-1]) or (p[i]>p[i+1] and p[i]<p[i-1]):
    cnt+=1;


   
  
print(cnt)

s=[]
s = input()
cnt=0

if (s[0] == s[1]):
    cnt+=1

if(s[0] == s[2]):
    cnt+=1


if(s[0] == s[3]):
    cnt+=1


if(s[1] == s[2]):
    cnt+=1


if(s[0] == s[3]):
    cnt+=1


if(s[2] == s[3]):
    cnt+=1


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

s=[]
s = input()
cnt=0
 
if(s[0] == s[1]):
    cnt+=1

if(s[0] == s[2]):
    cnt+=1
 
 
if(s[0] == s[3]):
    cnt+=1
 
 
if(s[1] == s[2]):
    cnt+=1
 
 
if(s[1] == s[3]):
    cnt+=1
 
 
if(s[2] == s[3]):
    cnt+=1
 
 
if cnt == 2 :
  print("Yes")
else :
  print("No")

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 = list(input())
S.sort()
if S[0]==S[1] and S[2]==S[3]:
  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

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()
chars = sorted(list(S))
if chars[0] == chars[1] and chars[2] == chars[3]:
    print("YES")
else:
    print("NO")

S = input()
chars = sorted(list(S))
if chars[0] == chars[1] and chars[1] != chars[2] and chars[2] == chars[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):
S = input()
chars = []
for i in range(len(S)):
    chars.append(S[i])
if chars.count(chars[0]) == 2:
    for i in range(1, len(S) + 1):
        if chars[i] == 2:
            print("Yes")
else:
    print("No")

S = input()
chars = []
for i in range(len(S)):
    chars.append(S[i])
if chars.count(chars[0]) == 2:
    for i in range(len(S)):
        if chars.count(chars[i]) != 2:
            print("No")
            break
    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):
s = (input()

s1 = s[0]
if s.count(s1) == 2:
    s = s.replace(s1, "")
    s2 = s[0]
    if s.count(s2) == 2:
        print('Yes')
    else:
        print('No')
else:
    print('No')


s = str(input())

if str.count(s[0]) == str.count(s[1]) == str.count(s[2]) == str.count(s[3]) == 2:
    print('Yes')
else:
    print('No')


s = input()

s1 = s[0]
if s.count(s1) == 2:
    s = s.replace(s1, "")
    s2 = s[0]
    if s.count(s2) == 2:
        print('Yes')
    else:
        print('No')

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):
print("YES" if len(set(input())) == 2 else "NO")

print("Yes" if len(set(input())) == 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):

from math import lgamma
lfact = lambda n: lgamma(n + 1)
cmb = lambda n, r: lfact(n) - lfact(n - r) - lfact(r)

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

#def cmb(n, k):
#    m = 1
#    if n < 2 * k:



#    return m

for i in range(1,k+1):
    print(
            int(cmb(k-1, i-1) * cmb(n-k+1, i) % (10**9+7))
            )

n = int(input())
l = list(map(int,input().split()))

ans = 0

for i in range(n-2):
    tmp = list([l[i],l[i+1],l[i+2]])
    if max(tmp) != tmp[1] and min(tmp) != tmp[1]:
        ans += 1
print(ans)


n = int(input())
l = list(map(int,input().split()))

ans = 0

for k in range(min(l)+1, max(l)):
    l_abc = [i for i in l if i < k]
    l_arc = [i for i in l if i >= k]
    if len(l_abc) == len(l_arc):
        ans += 1

print(ans)

s = list(map(str, input()))

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


s = list(map(str, input()))

if s.count(s[0])==2:
    s_rm = [i for i in s if i != s[0]]
    if s_rm[0] == s_rm[1]:
        print("Yes")
    else:
        print("No")
else:
    print("No")


Verdicts: Runtime Error

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):
x=input().split()
list_moji=[]
count=0
for i in range(len(x)):
  if x[i] in x:
    count+=1
x=set(x)
if len(x)==2 and count==4:
	print("Yes")
else:
  print("No")
    
  

x = list(input())

count=0
for i in range(len(x)):
    if x[i] in x:
        count += 1
x = set(x)

if len(x) == 2 and 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):
import pandas
import math
import numpy
import collections

x = input()
TF =  x.isupper() and x.isalpha()
if(TF):
    li = [i for i in x]
    count_dict = collections.Counter(li)
    list = [v for k, v in count_dict.items()]
    
    if(list == [2,2]):
        print(True)
    else:
        print(False)
print(False)
        

import pandas
import math
import numpy
import collections

x = input()
TF =  x.isupper() and x.isalpha()
if(TF):
    li = [i for i in x]
    count_dict = collections.Counter(li)
    list = [v for k, v in count_dict.items()]
    
    if(list == [2,2]):
        print("Yes")
        
print("No")

import pandas
import math
import numpy
import collections

x = input()
TF =  x.isupper() and x.isalpha()
if(TF):
    li = [i for i in x]
    count_dict = collections.Counter(li)
    list = [v for k, v in count_dict.items()]
    
    if(list == [2,2]):
        print("Yes")
    else:
        print("No")
print("No")
        

import collections

x = input()
TF =  x.isupper() and x.isalpha()
flg  = 0
if(TF):
    li = [i for i in x]
    count_dict = collections.Counter(li)
    list = [v for k, v in count_dict.items()]
    if(list == [2,2]):
        print("Yes")
        flg = 1
if(flg == 0):
    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()
L=[]
for i in range(3):
    L.apend(S.count(S[i]))
if sum(L)==6:
    print('Yes')
else:
    print('No')

S=input()
L=[]
for i in range(3):
    L.append(S.count(S[i]))
if sum(L)==6:
    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()
t = list(s)[0]
s = s.replace(t, '', 2)
if(list(s)[0] != t):
    s = s.replace(t, '', 2)
if(len(s) == 0):
    print("Yes")
else:
    print("No")


s = input()
t = list(s)[0]
s = s.replace(t, '', 2)
if(s != t):
    s = s.replace(t, '', 2)
if(len(s) == 0):
    print("Yes")
else:
    print("No")


s = input()
t = list(s)[0]
s = s.replace(t, '', 2)
if(list(s)[0] != t):
    s = s.replace(t, '', 2)
if(len(s) == 0):
    print("Yes")
else:
    print("No")


s = input()
t = list(s)[0]
s = s.replace(t, '', 2)
if(list(s)[0] != t):
    s = s.replace(list(s)[0], '', 2)
if(len(s) == 0):
    print("Yes")
else:
    print("No")


Verdicts: 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()
u = set()
for let in s:
  u.add(let)
count=0
for let in s:
  if s[0] == let:
    count += 1
if count ==2 and u.size()==2:
  print('Yes')
else:
  print('No')

s=input()
u = set()
for let in s:
  u.add(let)
count=0
for let in s:
  if s[0] == let:
    count += 1
if count ==2 and u.size()==2:
  print("Yes")
else:
  print("No")


s=input()
u = set()
for let in s:
  u.add(let)
count=0
for let in s:
  if s[0] == let:
    count += 1
if count ==2 and len(u)==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):
from collections import Counter


s = input()
c = Counter(s)
if len(c) == 2 and c.most_common(1)[1] == 2:
    print("Yes")
else:
    print("No")


from collections import Counter


s = input()
c = Counter(s)
if len(c) == 2 and c.most_common(1)[0][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):
a = input()
if len(set(a))==2 and list(a).count(list(set(a))[0])==2:
    print("YES")

a = input()
if len(set(a))==2 and list(a).count(list(set(a))[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):
from collections import Counter
c = True
for (k, v) in Counter(input()):
  if v != 2:
    c = False
if c:
  print("Yes")
else:
  print("No")

from collections import Counter
c = True
for (k, v) in Counter(input()).items():
  if v != 2:
    c = False
if c:
  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()
S=sorted(S)
print(S)
if S[0] == S[1] != S[2] ==S[3]:
    print("Yes")
else:
    print("No")

S = input()
S=sorted(S)

if S[0] == S[1] != 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):
s = sorted(input())
print("Yes" if s[0]==s[1] and S[1]!=S[2] and s[2]==s[3] else "No")

from collections import Counter
s = Counter(input()).values()
print("Yes" if min(s)==max(s) and len(s)==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):
str_list = input()
cnt=0
for i in range(4):
  if str_list[i] == str_list[0]:
    cnt+=1
if (len(set(str_list))==2) and (cnt==2):
  print("YES")
else:
  print("NO")


str_list = input()
cnt=0
for i in range(4):
  if str_list[i] == str_list[0]:
    cnt+=1
if (len(set(str_list))==2) and (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):
from collections import Counter

arr = list(input())
c = Counter(arr)
print("YES" if c.most_common()[0][1] == 2 and c.most_common()[1][1] == 2 else "NO")

a, b, c, d = input()

string_set = set(a, b, c, d)

print("YES" if len(string_set) == 2 and not a ^ b ^ c ^ d else "NO")

from collections import Counter

arr = list(input())
c = Counter(arr)
print("Yes" if c.most_common()[0][1] == 2 and c.most_common()[1][1] == 2 else "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):
a = list(input())
if len(set(a)) == 2:
  count = 0
  for r in set(a):
    if r.count(a) == 2:
      count += 1
  if count == 2:
    print("Yes")
  else:
    print("No")
else:
  print("No")

a = list(input())
if len(set(a)) == 2:
  count = 0
  for r in set(a):
    if a.count(r) == 2:
      count += 1
  if count == 2:
    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 = sorted(input())
ans = 'YES' if s[0] == s[1] and s[1] != s[2] and s[2] == s[3] else 'No'
print(ans)


s = sorted(input())
ans = 'Yes' if s[0] == s[1] and s[1] != s[2] and s[2] == s[3] 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):
n= input()

n_list=list(n)

a=(n_list.count(n_list[0]))
b=(n_list.count(n_list[1]))
c=(n_list.count(n_list[2]))
d=(n_list.count(n_list[3]))
print(a,b,c,d)
if a==2:
    if b==2:
        if c==2:
            if d==2:
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")


n= input()

n_list=list(n)

a=(n_list.count(n_list[0]))
b=(n_list.count(n_list[1]))
c=(n_list.count(n_list[2]))
d=(n_list.count(n_list[3]))
print(a,b,c,d)
if (a==3 and c==and b==2 and d==2):
    print("Yes")
else:
    print("No") 

n= input()

n_list=list(n)

a=(n_list.count(n_list[0]))
b=(n_list.count(n_list[1]))
c=(n_list.count(n_list[2]))
d=(n_list.count(n_list[3]))

if a==2:
    if b==2:
        if c==2:
            if d==2:
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        print("No")
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 = input()
s = set(S)

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

S = input()
s = list(set(S))

print('Yes' if len(s)==2 and S.count(s[0]) == S.count(s[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):
from collections import defaultdict
s = str(input())
d = defaultdict(int)
for x in s:
  d[x]+=1
if len(d)==2:
  for key,value in d:
    if value!=2:
      print("No")
      exit()
  print("Yes")
else:
  print("No")
  


from collections import defaultdict
s = str(input())
d = defaultdict(int)
for x in s:
  d[x]+=1
if len(d)==2:
  for key in d:
    if d[key]!=2:
      print("No")
      exit()
  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 = list(input().rstrip())
ans = Counter(S)
print("Yes") if len(ans)==2 & list(ans.values())[0]==2 & list(ans.values())[1]==2 else print("No")

from collections import Counter
S = list(input().rstrip())
ans = Counter(S)
print("Yes") if len(ans)==2 & list(ans.values())[0]==2 & list(ans.values())[1]==2 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):
word=input()
word=sorted(word)
print(word)

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


string=input()
list=[]
for i in range(0,len(string)):
         if string[i] not in list:
            list.append(string[i])

         if string[i] not in list:
            list.append(string[i])

if(len(list)==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):
M=input()


if M.count(M[0])+ M.count(M[1])+ M.count(M[2])+ M.count(M[3])=8:
  print("Yes")
else:
  print("No")

M=input()


if M.count(M[0])+ M.count(M[1])+ M.count(M[2])+ M.count(M[3])==8:
  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())
if (s[0]==s[1] and s[2]==s[3]) or (s[0]==s[2] and s[3]==s[1]) or (s[0]==s[3] and s[2]==s[1]):
    print('YES')
else:
    print('NO')


if len(set(input())) == 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):
import itertools
import sys

def hantei(s):
  i = 0
  for s1, s2 in itertools.combinations(s, 2):
    if s1 == s2:
      i += 1
    print(s1, s2)
  
  return 'Yes' if i == 2 else 'No'


if __name__ == '__main__':
  args = sys.stdin
  
  for arg in args:
    print(hantei(str(arg)))


import itertools
import sys

def hantei(s):
  hantei = s.isupper()
  
  if hantei:
    i = 0
    for s1, s2 in itertools.combinations(s, 2):
      if s1 == s2:
        i += 1
    hantei = 'Yes' if i == 2 else 'No'
  else:
    hantei = 'No'
    
  return hantei


if __name__ == '__main__':
  args = sys.stdin
  
  for arg in args:
    print(hantei(str(arg)))


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()

if a[0] == a[1] and a[2] == a[3]: //AABB
	print("Yes")
elif a[0] == a[2] and a[1] == a[3]: //ABAB
	print("Yes")
elif a[0] == a[3] and a[1] == a[2]: //ABBA
	print("Yes")
else:
  	print("No")

a = input()

if a[0] == a[1] == a[2] == a[3]:
    print("No")
elif a[0] == a[1] and a[2] == a[3]:
    print("Yes")
elif a[0] == a[2] and a[1] == a[3]:
    print("Yes")
elif a[0] == a[3] and a[1] == 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):
S = input()
if S.count(S[0]) != 4:
    if S[0] == S[1] and S[2] == S[3]:
        print("YES")
        exit()
    if S[0] == S[2] and S[1] == S[3]:
        print("YES")
        exit()
    if S[0] == S[3] and S[1] == S[2]:
        print("YES")
        exit()
print("NO")

S = input()
if S.count(S[0]) != 4:
    if (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")
        exit()
print("NO")

S = input()
if S.count(S[0]) != 4:
    if (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")
        exit()
print("NO")

S = input()
if S.count(S[0]) != 4:
    if S[0] == S[1] and S[2] == S[3]:
        print("Yes")
        exit()
    if S[0] == S[2] and S[1] == S[3]:
        print("Yes")
        exit()
    if S[0] == S[3] and S[1] == S[2]:
        print("Yes")
        exit()
print("No")

Verdicts: 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):
A=list(input().split())

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

A=list(map(int,input()))

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

A=list(map(str,input()))

if A[0]==A[1] and A[0]==A[2] and A[0]==A[3]:
    print("No")
elif A[0]==A[1] and A[2]==A[3]:
    print("Yes")
elif A[0]==A[2] and A[1]==A[3]:
    print("Yes")
elif A[0]==A[3] and A[1]==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):
S = map(str , input())
list_S = list(S)

list_S.sort

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

s = input()
n = s.count(s[0])
print("YNeos"[n!=2 or len(set(s))!=2::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):
s=input()
if len(set(s))==2 and s.count(s[0])==2:
  print("Yes")
else:
  print("No)

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


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


s=input()
if len(set(s))==2 and list(s).count(s[0])==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):
n = int(input())
d = map(int, input().split())
d = list(d)

import statistics
t = len(d) / 2
k_low = statistics.median_low(d)
k_high = statistics.median_high(d)

c = 0
C = 0
for i in d:
    if i < k_low:
        c +=1
    else:
        c+=0
        
if c == t:
    C += 1
else:
    C += 0

c = 0
for i in d:
    if i >= k_high:
        c +=1
    else:
        c+=0
        
if c == t:
    C += 1
else:
    C += 0
    
print(C)

S = str(input())
s = list(S)

s0 = s[0]
s1 = s[1]
s2 = s[2]
s3 = s[3]

c0 = S.count(s0)
c1 = S.count(s1)
c2 = S.count(s2)
c3 = S.count(s3)
ct = c0 + c1 + c2 + c3
ct

if ct == 8:
    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 = list(input())
ans = 'Yes'
for i in set(S):
    print(i)
    if not(S.count(i) == 2):
        ans = 'No'
        break

print(ans)


S = list(input())
count = list(S.count(i) for i in set(S))
if len(count) == 2 and count[0] == count[1] and count[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):
import collections

if __name__ == '__main__':
    l = list(input())
    c = collections.Counter(l)
    for char, count in c.most_common(2):
        if count != 2:
            print(False)
            exit()
    print(True)


import collections

if __name__ == '__main__':
    l = list(input())
    c = collections.Counter(l)
    for char, count in c.most_common(2):
        if count != 2:
            print("No")
            exit()
    print("Yes")


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
sys.setrecursionlimit(10000)

n, k = map(int,input().split())
nck = {}

def c(n,k):
    if k == 0 or n==k:
        return 1
    elif n<k:
        return 0
    elif k == 1:
        return n  
    elif (n,k) in nck:
        return nck[(n,k)]
    else:
        nck[n,k] = c(n-1,k-1)+c(n-1,k)
        return nck[n,k]

for j in range(1,k+1):
    r = (c(n-k+1,j)*c(k-1,j-1))%(10**9+7)
    print(r)

s = input()
s = sorted(s)
if s.count(s[0]) == 2 and s.count(s[3]) == 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):
	from itertools import groupby

s = input()
result = True

for k, g in groupby(s):
        print(k, list(g))
        if s.count(k) is not 2:
                result = False

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

from itertools import groupby

s = input()
result = True

for k, g in groupby(s):
        if s.count(k) is not 2:
                result = False

if result:
        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):
str = input()

char_count = 1
for i in range(3):
    if str[0] == str[i+1]:
        char_count += 1
    else:
        char2 = i+1
        char2_count = 0
        
if char_count == 2:
    for char in str:
        if str[char2] == char:
            char2_count += 1
            
    if char2_count == 2:
        print("Yes")
        
    else:
        print("No")
        
else:
    ("No")
    
    
print(char_count, char2_count)

str = input()

chars = {}
for char in str:
    if char in chars:
        chars[char] += 1
    else:
        chars[char] = 1
        
if len(chars) == 2 and chars[str[0]] == 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 = int(input())
# S = "SASA"
arr = []
for s in S:
    arr.append(s)
if (arr[0] == arr[1]):
    if (arr[2] == arr[3]):
        ans = "Yes"
    else:
        ans = "No"
else:
    if (arr.count(arr[0]) == 2 and arr.count(arr[1]) == 2):
        ans = "Yes"
    else:
        ans = "No"

print(ans)



S = input()
arr = []
for s in S:
    arr.append(s)
if (arr[0] == arr[1]):
    if (arr[0] != arr[2] and arr[2] == arr[3]):
        ans = "Yes"
    else:
        ans = "No"
else:
    if (arr.count(arr[0]) == 2 and arr.count(arr[1]) == 2):
        ans = "Yes"
    else:
        ans = "No"

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):
n = int(input())
ns = map(input().split(), int)

c = 0
for i in range(1, n):
  if sorted([ns[i-1], ns[i], ns[i+1]])[2] == ns[i]:
    c += 1
    
print(c)

a = input()
b = list(set(list(a)))
print('Yes' if len(b) == 2 and a.count(b[0]) == 2 and a.count(b[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):
a = input()
b = len(a)
d = 0

for x in range(b):
    c = a.count(a[x])
    if c > 1:
         d += 1

if d == 2:
    print('Yes')
else:
    print('No')



a = input()
b = len(a)
d = 0

for x in range(b):
    c = a.count(a[x])
    if c == 2:
         d += 1

if d == b:
    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 len(set(s)) == 2 and s. count(s[0]) == 2:
    print('Yes')
 else:
     print('No')

s = input()

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

s = input()

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

Verdicts: 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[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)
else:
  print(No)

S = input()

if S[0] == S[1] == S[2] == S[3]:
  print('No')
elif S[0] == S[1] and S[2] == S[3]:
  print('Yes')
elif S[0] == S[2] and S[1] == S[3]:
  print('Yes')
elif S[0] == S[3] and S[1] == 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 = input()
S=str(S)

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

S = input()
S=str(S)

if S[0]==S[1]:
  if S[2]==S[3]:
    if S[0] != S[2]:
      print('Yes')
    else:
      print('No')
  else:
  	print('No')
elif S[0]==S[2]:
  if S[1]==S[3]:
    if S[0] != S[1]:
      print('Yes')
    else:
      print('No')
  else:
  	print('No')
elif S[0]==S[3]:
  if S[1]==S[2]:
    if S[0] != S[1]:
      print('Yes')
    else:
      print('No')
  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):
n=input()
m=set(sorted(n))
a,b=0,0
for i in n:
    if len(m)!=2:
        print("No")
        break
    if i==m[0]:
        a+=1
    elif i==m[1]:
        b+=1
else:
    if a==2 and b==0:
        print("Yes")
    else:
        print("No")

n=input()
m=set(n)
a,b=0,0
for i in n:
    if len(m)!=2:
        print("No")
        break
    if i==m[0]:
        a+=1
    elif i==m[1]:
        b+=1
else:
    if a==2 and b==0:
        print("Yes")
    else:
        print("No")

n=input()
m=set(n)
if len(m)==2 and n.count(m[0]):
    print("Yes")
else:
    print("No")

n=input()
m=set(n)
if len(m)==2 and n.count(n[0])==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,b,c,d = input().split()

if a == b and b != c and c == d:
  print('Yes')
elif a == c and b != c and b == d:
  print('Yes')
elif a == d and a != b and b == c:
  print('Yes')
else:
  print('No')

w = input()
a = w[0]
b = w[1]
c = w[2]
d = w[3]
 
if a == b and b != c and c == d:
  print('Yes')
elif a == c and b != c and b == d:
  print('Yes')
elif a == d and a != b and b == c:
  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):
# @author 

import sys

class AFiftyFifty:
    def solve(self):
        s = list(input())
        s.sort()
        print("Yes" if (s[0] == s[1] and s[2] == s[3]) else "No")


solver = AFiftyFifty()
input = sys.stdin.readline

solver.solve()


# @author 

import sys

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


solver = AFiftyFifty()
input = sys.stdin.readline

solver.solve()


# @author 

import sys

class AFiftyFifty:
    def solve(self):
        s = list(input().strip())
        s.sort()
        print("Yes" if (s[0] == s[1] and s[2] == s[3] and s[0] != s[2]) else "No")


solver = AFiftyFifty()
input = sys.stdin.readline

solver.solve()


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):
import sys


s = sys.argv[1]
# print(len(s))

if len(s) == 4:
    if s.count(s[0]) == 2:
        if s.count(s[1]) == 2:
            if s.count(s[2]) == 2:
                if s.count(s[3]) == 2:
                    print("Yes")
                    exit()
print("No")
exit()


import sys


s = sys.argv[1]

if len(s) == 4:
    if s.count(s[0]) == 2:
        if s.count(s[1]) == 2:
            if s.count(s[2]) == 2:
                if s.count(s[3]) == 2:
                    print("Yes")
                    exit()
print("No")
exit()


import sys

s = input()
if len(s) == 4:
    if s.count(s[0]) == 2:
        if s.count(s[1]) == 2:
            if s.count(s[2]) == 2:
                if s.count(s[3]) == 2:
                    print("Yes")
                    exit()
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 = input()

a = {}

for i in s:
    if i in a:
        a[i] += 1
    else:
        a[i] = 1

if len(a) == 2:
    values = list(a.values())
    if values == [2,2]:
        print("YES")
        exit()
print("NO")


s = input()

a = {}

for i in s:
    if i in a:
        a[i] += 1
    else:
        a[i] = 1

if len(a) == 2:
    values = list(a.values())
    if values == [2,2]:
        print("Yes")
        exit()
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()
l = list(S)
l_unique = list(set(l))
count = 0
for i in range(len(l_unique)):
  if l.count(l_unique[i]) == 2 :
    count += 1
if count == len(l) //2 :
  print('Yse')
else:
  print('No')

S = input()
l = list(S)
if l.count(l[0]) == 2 and l.count(l[1]) == 2 and l.count(l[2]) == 2 and l.count(l[3]) == 2 :
  print('Yse')
else:
  print('No')

S = input()
l = list(S)
if l.count(l[0]) == 2 and l.count(l[1]) == 2 and l.count(l[2]) == 2 and l.count(l[3]) == 2 :
  print('Yes')
else:
  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):
t = input()
a = [i for i in t]
print(a)
b = list(set(a))
if len(b) == 2:
    if a.count(a[0]) ==2:
        print("Yes")
    else:
        print("No")
else:
    print("No")


t = input()
a = [i for i in t]
b = list(set(a))
if len(b) == 2:
    if a.count(a[0]) ==2:
        print("Yes")
    else:
        print("No")
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=input()
n.sort()
if n[0]==n[1] and n[2]==n[3]:
  print("Yes")
  
else:
  print("No")

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

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


Verdicts: 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()
ss = list(s)

con = True
for i in ss:
  con = False if ss.count(i) != 2 
  
  
if con:
  print("Yes")
else:
  print("No")
    

s = input()
ss = list(s)

con = True
for i in ss:
  if ss.count(i) != 2:
    con = False
if con:
  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):
n = int(input().rstrip())
p = [int(x) for x in input().rstrip().split()]

count = 0
for i in range(1, n - 1):
    if (p[i] > p[i - 1] and p[i] < p[i + 1]) or \
        (p[i] < p[i - 1] and p[i] > p[i + 1]):
        count += 1
print(count)


from collections import defaultdict

S = input().rstrip()

char_dict = defaultdict(int)
for char in S:
    char_dict[char] += 1

kind = len(char_dict.keys())
val_set = set(char_dict.values())

if kind == 2 and val_set == {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()
if len(set(S)) == 2 and S.count(S[0]) == 2:
  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):
def main():
  s = input()
  if len(set(s)) == 2:
    a = 0
    for i in range(1, 3):
      a += 1 if s[0] == s[i] else 0
    print('Yes' if a == 1 else 'No')
  else:
    print('No')


if __name__ == '__main__':
  main()

def main():
  s = input()
  if len(set(s)) == 2:
    a = 0
    for i in range(1, 4):
      a += 1 if s[0] == s[i] else 0
    print('Yes' if a == 1 else 'No')
  else:
    print('No')


if __name__ == '__main__':
  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):
n = int(input())
a = list(map(int, input().split()))
cnt = 0
for i in range(n-2):
    if a[i] < a[i+1] < a[i+2] or a[i+2] < a[i+1] < a[i]
        cnt += 1
print(cnt)

s = sorted(input())
if s[0] == s[1] and s[1] != s[2] 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 = [i for i in input().strip().split()]
S.sort()
if (S[0] == S[1]) and (S[2] == S[3]) and (S[1] != S[2]):
  print("Yes")
else
  print("No")


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


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


S = input()
S = sorted(S)
if S[0] == S[1] and S[1] != S[2] and S[2] == S[3]:
  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):

N,K = map(int,input().split(' '))
MOD = 10**9 + 7

n = N-K+1
print(n)
for i in range(2,K+1):
	n = (n * (N-K+2-i) * (K-i+1) // (i * (i-1)))
	print(n % MOD)



s=input()
dic={}
for i in range(4):
    if s[i] in dic.keys():
        dic[s[i]]+=1
    else:
        dic[s[i]]=1
ans=0
for i in range(4):
    if dic[s[i]]!=2:
        ans=1
if ans==0:
    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 = list(input())
count = 0
print(s)
if s[0]==s[1]:
	count += 1
if s[0]==s[2]:
	count += 1
if s[0]==s[3]:
	count += 1
if s[1]==s[2]:
	count += 1
if s[1]==s[3]:
	count += 1
if s[2]==s[3]:
	count += 1
print(count)
print("Yes" if len(set(s))==2 and count==2 else "No")


s = list(input())
count = 0
if s[0]==s[1]:
	count += 1
if s[0]==s[2]:
	count += 1
if s[0]==s[3]:
	count += 1
if s[1]==s[2]:
	count += 1
if s[1]==s[3]:
	count += 1
if s[2]==s[3]:
	count += 1
print("Yes" if len(set(s))==2 and count==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()
a=[]
b=[]
for i in s:
    a.append(i)

for j in a:
    if j not in b:
        b.append(j)

c=[]
for k in b:
    c.append(a.count(k))

if c.count(2)>=2:
    print("YES")
else:
    print("NO")

s=input()
a=[]
b=[]
for i in s:
    a.append(i)

for j in a:
    if j not in b:
        b.append(j)

c=[]
for k in b:
    c.append(a.count(k))

if c.count(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 = str(input())
count=0
for i in range(len(S)-1):
  for j in range(i,len(S)):
    if S[i] == S[j]:
      count+=1
if count==2:
  print("Yes")
else:
  print("No")

S = str(input())
count=0
for i in range(len(S)-1):
  for j in range(i+1,len(S)):
    if S[i] == S[j]:
      count+=1
if 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())
S.sort()
print(S)
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')

S = list(input())

if S[0] == S[1]:
    print('Bad')
elif S[1] == S[2]:
    print('Bad')
elif S[2] == S[3]:
    print('Bad')
else:
    print('Good')


S = list(input())
S.sort()

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: 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 = list(input())
S2 = sorted(S)

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

import itertools
S = list(input())
S2 = list(set(S))

if len(S2) == 2:
    print('YES')
else:
    print('No')

S = list(input())
S2 = sorted(S)

if S2[0] == S2[1] and S2[2] == S2[3] and S2[1] != S2[2]:
    print('Yes')
else:
    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):
s = input()
t = set(s)
if len(t) == 2 and s.count(list(t[0])) == 2:
  print("Yes")
else:
  print("No")

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

s = input()
t = set(s)
if len(t) == 2 and s.count(list(t)[0]) == 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=input()

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

s=input()

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

s=input()

if s[0]==s[1] and s[0]==s[2] and s[0]==s[3]:
    print("No")
elif(s[0]==s[2] and s[1]==s[3]) or (s[0]==s[1] and s[2]==s[3]) or (s[0]==s[3] and s[1]==s[2]):
    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 = input()
s.sort()
if s[0] == s[1] and s[2] == s[3]:
    print("Yes")
else:
    print("No")

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

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 scipy.special import comb, factorial

n, k = tuple(map(int, input().split(' ')))
for i in range(1, k+1):
  s = comb(k-1, i-1, exact=True) * (factorial(n-k+1, exact=True) / (factorial(n-k-i+1, exact=True) * factorial(i, exact=True)))
  print(int(s) % (10 ** 9 + 7))

input_str = input()
items = set(list(input_str)
return 'Yes' if len(items) == 2 and len(list(input_str.replace(list(items)[0], ''))) == 2 else 'No'

from scipy.special import comb, factorial

try:
  n, k = tuple(map(int, input().split(' ')))
  for i in range(1, k+1):
    print(comb(k-1, i-1, exact=True) * (factorial(n-k+1, exact=True) // (factorial(n-k-i+1, exact=True) * factorial(i, exact=True))) % (10 ** 9 + 7))
except Exception as e:
  print(e)

input_str = input()
items = set(list(input_str))
print('Yes' if len(items) == 2 and len(list(input_str.replace(list(items)[0], ''))) == 2 else 'No')

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted