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().split()
s = [c for c in s[0]]

if s[0] == s[1] and s[1] == s[2]:
        print('No')

else:
    for i in range(1, len(s)):
        if s[0] == s[i]:
            buf = i
        else:
            buf = 0
    if buf == 0:
        print('No')
    else:
        print(buf)
        nokori = []
        for i in range(1, len(s)):
            if i == buf:
                continue
            else:
                nokori.append(s[i]) 
                print(nokori)
        if nokori[0] == nokori[1]:
            print('Yes')
        else:
            print('No')

s = input().split()
s = [c for c in s[0]]

if s[0] == s[1] and s[1] == s[2]:
        print('No')

else:
    for i in range(1, len(s)):
        if s[0] == s[i]:
            buf = i
            break
        else:
            buf = 0
    if buf == 0:
        print('No')
    else:
        nokori = []
        for i in range(1, len(s)):
            if i == buf:
                continue
            else:
                nokori.append(s[i]) 
        if nokori[0] == nokori[1]:
            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_list = set(list(S))
print(S_list)




if len(S_list) == 2:
    print("Yes")
else:
    print("No")


n = int(input())
P_list = list(map(int,(input().split(" "))))
#print(P_list)
count = 0
i = 0
for i in range(n-2):
    if P_list[i] > P_list[i+1] > P_list[i+2] or P_list[i] < P_list[i+1] < P_list[i+2]:
        count = count + 1

#print(n)
#print(P_list)
print(count)



S = input()
S_list = set(list(S))
#print(S_list)




if len(S_list) == 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()

if len(set(s)) == 2 and l.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: 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()

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

a = sorted(input())
print("Yes" if a[0] == a[1] and a[2] == a[3] and a[2] != a[1] 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):
import sys


S = [str(s) for s in input()]

s_dic = {}
for s in S:
    if s in s_dic.keys():
        s_dic[s] += 1
    else:
        s_dic[s] = 1


for i in s_dic.values():
    if int(i) != 2:
        print("NO")
        sys.exit()

print("YES")


import sys


S = [str(s) for s in input()]

s_dic = {}
for s in S:
    if s in s_dic.keys():
        s_dic[s] += 1
    else:
        s_dic[s] = 1


for i in s_dic.values():
    if int(i) != 2:
        print("No")
        sys.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):
s=list(input())
if len((s))==2:
  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')
else:
  print('No')


s=list(input())
if len((s))==2:
  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] or s[1]==s[2]):
    print('Yes')
  else:
    print('No')
else:
  print('No')

s=sorted(list(input()))
if s.count(s[0])==2 and s.count(s[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):
S=sorted(list(input()))
if S[0]==S[1] and S[1]!=S[2] and S[2]=S[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")

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

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):
print(len(set(input())))

print("Yes") if len(set(input())) == 2 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 S[0] == S[1] and S[2] == S[3]:
        ans = "Yes"
    elif S[0] == S[2] and S[1] == S[3]:
        ans = "Yes"
    elif S[0] == S[3] and S[1] == S[2]:
        ans = "Yes"
    else:
    else:
        ans = "No"
    print(ans)


if __name__ == '__main__':
    main()


def main():
    S = input()
    if S[0] == S[1] == S[2] == S[3]:
        ans = "No"
    elif S[0] == S[1] and S[2] == S[3]:
        ans = "Yes"
    elif S[0] == S[2] and S[1] == S[3]:
        ans = "Yes"
    elif S[0] == S[3] and S[1] == S[2]:
        ans = "Yes"
    else:
        ans = "No"
    print(ans)


if __name__ == '__main__':
    main()


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) # list of sorted data

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

s = input()
s = sorted(s) # list of sorted data

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):
import numpy as np
n = int(input())
dif = np.array(list(map(int, input().split())))
divide = 0
for k in range(min(dif), max(dif)+1):
    count_over = 0
    count_under = 0
    for i in range(len(dif)):
        if dif[i] >= k:
            count_over += 1
        else:
            count_under += 1
    if count_over == count_under:
        divide += 1
print(divide)

s = input()

if s[0] == s[1] and s[2] == s[3] and s[1] != s[2]:
    print('Yes')
elif s[0] == s[2] and s[1] == s[3] and s[1] != s[2]:
    print('Yes')
elif s[0] == s[3] and s[1] == s[2] and s[1] != 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()
S = S.replace(S[0],"")
print(S)

if len(S) > 0:
    S = S.replace(S[0],"")
    if len(S) == 0:
        print("Yes")
    else:
        print("No")
else:
    print("No")


S = input()
S = S.strip(S[0])

if len(S[0]) > 0:
    S = S.strip(S[0])
    if len(S) == 0:
        print("YES")
    else:
        print("NO")
else:
    print("NO")


S = input()
S = S.replace(S[0],"")
if len(S) > 0:
    S = S.replace(S[0],"")
    if len(S) == 0:
        print("Yes")
    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):
if S[0] == S[1] and S[2] == S[3] and S[0] == S[2]:
    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[2] == 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("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[2] == 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):
a=input()
print('YNeos'[map(a.count,a)!=map(2,a)::2])

s=sorted(input())
print('Yes'if(s[::2]==s[::-2])&(s[0]!=s[-1]
)else'No')

a=list(input())
print('YNeos'[sum(map(a.count,a))!=8::2])

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):
def func():
    input_line = list(str(input('Put any literal: ')))
    for i in range(len(input_line)):
        for j in range(i+1,len(input_line)):
            if input_line[i] == input_line[j]:
                print('Yes')
                return
    print('No')


if __name__ == "__main__":
    func()
                

def func():
    input_line = list(str(input('Put any literal: ')))
    flag = 0
    for i in range(len(input_line)):
        for j in range(i+1,len(input_line)):
            if input_line[i] == input_line[j]:
                flag += 1
    if flag == 1:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    func()
                

    input_line = list(str(input('Put any literal: ')))
    for i in range(len(input_line)):
        for j in range(i+1,len(input_line)):
            if input_line[i] == input_line[j]:
                print('Yes')
                return
    print('No')


def func():
    input_line = list(str(input('Put any literal: ')))
    flag = 0
    for i in range(len(input_line)):
        for j in range(i+1,len(input_line)):
            if input_line[i] == input_line[j]:
                flag += 1
    if flag == 2:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    func()
                

def func():
    input_line = list(str(input('')))
    flag = 0
    for i in range(len(input_line)):
        for j in range(i+1,len(input_line)):
            if input_line[i] == input_line[j]:
                flag += 1
    if flag == 2:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    func()
                

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


temp1 = S[1]
temp2 = S[2]
temp3 = S[3]
temp4 = S[4]


if temp1 == temp2 and temp3 == temp4 and len(set(S))==2:
    print("Yes")
elif temp1 == temp3 and temp2 == temp4 and len(set(S))==2:
    print("Yes")
elif temp1 == temp4 and temp2 == temp3 and len(set(S))==2:
    print("Yes")
else:
    print("No")


S = input()

S = S.split()

S = list(set(S))

if len(S == 2:
    print("Yes)
else:
    print("No")


S = input()

count_1 = 0
count_2 = 0

if len(set(S))==2:
    list = list(set(S))

    if S.count(list[0])==2 and S.count(list[1])==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):
a=map(str, input())
char=list(a)
b=set(char)
c=len(b)
if c=2:
	print("Yes")
else:
  print("No")
  
  

a=map(str, input())
char=list(a)
b=set(char)
c=len(b)
if c==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().split()
print(count(A[0]))

A = input()
B = [i for i in A]
B.sort()
if B.count(B[0]) == 2:
  if B.count(B[-1]) == 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 = str(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 = str(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 = str(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):
s=input()
ans="Good"
for i in range(3):
  if s[i]==s[i+1]:
    ans="Bad"
print(ans)

s=list(input())
print("Yes" if len(set(s))==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):
i = input()
j = [_ for _ in i]
set(j)
if len(j) == 2:
  print("Yes")
else:
  print("No")

i = input()
j = [_ for _ in i]
j = set(j)
print(j)
if len(j) == 2:
  print("Yes")
else:
  print("No")

i = input()
j = [_ for _ in i]
j = set(j)
if len(j) == 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()
s1 = set(input())
if len(s1)==2:
  if s.count(list(s1)[0])==2 and s.count(list(s1)[1])==2: print('YES')
  else: print('NO')
else: print('NO')

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

S = input()
if S[0]==S[1]==S[2]==S[3]:
	print("No")
else:
	if S[0] == S [1]:
		if S[2] == S[3]:
			print("Yes")
		else:
			print("No")
	elif S[0] == S[2]:
		if S[1] == S[3]:
			print("Yes")
		else:
			print("No")
	elif S[0] == S[3]:
		if S[1] == S[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):
n=int(input())
p=list(map(int,input().split()))

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

print(c)

S=input()

if len(S)!=4:
  print('No')
else:  
  Sorted_S = sorted(S)
  
  L1=Sorted_S[0]
  L2=Sorted_S[1]
  L3=Sorted_S[2]
  L4=Sorted_S[3]

  if (L1==L2) and (L3==L4) and (L2!=L3):
    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()
 
for i in range(3):
    if S[i] == S[i+1]:
        print("Bad")
        break
else:
    print("Good")

s=input()
for i in range(3):
    if s[i]==s[i+1]:
        print('Bad')
        break
else:
    print('Good')

s=input()
for i in range(3):
    if s[i]==s[i+1]:
        print('Bad')
        break
else:
    print('Good')

s=input()
a=[]
for i in s:
    a.append(i)
if a[0]==a[1] and a[2]==a[3] and a[0]!=a[2]:
    print('Yes')
elif a[0]==a[2] and a[1]==a[3] and a[0]!=a[1]:
    print('Yes')
elif a[0]==a[3] and a[1]==a[2] and a[0]!=a[1]:
    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 = list(str(input()))
if (S[0]==S[1]) and (S[0]==S[2]) and (S[0]==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:

S = list(str(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:


S = list(str(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:

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

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):
w=input()
s=list(set(list(w)))

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

w=input()
s=set(list(w))

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

w=input()
s=list(set(list(w)))

if len(s) == 2 and w.count(s[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()
count_dic = {}
for a in s:
  if not a in count_dic:
    count_dic[a] = 1
  else:
    count_dic[a] += 1

  for v in count_dic.values():
    if v != 2:
      return False
  return True

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

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()
flag =False
S_set = set(list(S))

if len(S_set) == 2:
  count_1 = S.count(list(S_set)[0])
  count_2 = S.count(list(S_set)[1])
  if count_1 == 2 and count_2 == 2:
  	falg = True

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

S = input()
flag =False
S_set = set(list(S))

if len(S_set) == 2:
  count_1 = S.count(list(S_set)[0])
  count_2 = S.count(list(S_set)[1])
  print(count_1,count_2)
  if count_1 == 2 and count_2 == 2:
  	flag = True

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

S = input()
flag =False
S_set = set(list(S))

if len(S_set) == 2:
  count_1 = S.count(list(S_set)[0])
  count_2 = S.count(list(S_set)[1])
  if count_1 == 2 and count_2 == 2:
  	flag = True

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

word =input()
flag = 0

for i in range(4):
    if word.count(word[i]) == 2:
        flag += 1
    
if flag == 4:
    print("yes")
else:
    print("No")

import sys 

word =input()
flag = 0

for i in range(4):
    if word.count(word[i]) == 2:
        flag += 1
    
if flag == 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()
if 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[2]==s[3]:
  print("YES")
else:
  print("NO")

s = input()
if 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")

s = input()
if s[0]==s[1]!=s[2]==s[3]:
  print("Yes")
elif s[0]==s[2]!=s[1]==s[3]:
  print("Yes")
elif s[0]==s[3]!=s[1]==s[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):
#!/usr/bin/env python


while True :
	S = input('S = ')
	if len(S) == 4 and S.isupper() :
		break
	else :
		continue


char_list = list(S)

judge = 0


for i in range(3) :
	for j in range(3-i) : 
		if char_list[i] == char_list[i+j+1] :
			judge = judge + 1

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


#!/usr/bin/env python


while True :
	S = input()
	if len(S) == 4 and S.isupper() :
		break
	else :
		continue


char_list = list(S)

judge = 0


for i in range(3) :
	for j in range(3-i) : 
		if char_list[i] == char_list[i+j+1] :
			judge = judge + 1

if judge == 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 string
s = input()
d = {i:0 for i in string.ascii_uppercase}
for i in s:
  d[i] += 1

def solve():
	for i in d.values():
	  if i not in [0, 2]:
	    print("No")
        return
    print("Yes")

solve()


import string
s = input()
d = {i:0 for i in string.ascii_uppercase}
for i in s:
  d[i] += 1

def solve():
  for i in d.values():
    if i not in [0, 2]:
      print("No")
      return
  print("Yes")

solve()


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

cnt = 0
if n.count(n[0]) == 2:
  cnt += 1
if n.count(n[1]) == 2:
  cnt += 1
if n.count(n[2]) == 2:
  cnt += 1
if n.count(n[3]) == 2:
  cnt += 1

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

str = input()
if len(set(str)) == 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()

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

i = 0

if a == b:
  i += 1
if a == c:
  i += 1
if a == d:
  i += 1
  
if b == c:
  i += 1
if b == d:
  i += 1
if c == d:
  i += 1

if i == 2:
  print(YES)
else:
  print(NO)

S = input()

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

i = 0

if a == b:
  i += 1
if a == c:
  i += 1
if a == d:
  i += 1
  
if b == c:
  i += 1
if b == d:
  i += 1
if c == d:
  i += 1

if i == 2:
  print(YES)
else:
  print(NO)
S = input()

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

i = 0

if a == b:
  i += 1
if a == c:
  i += 1
if a == d:
  i += 1
  
if b == c:
  i += 1
if b == d:
  i += 1
if c == d:
  i += 1

if i == 2:
  print('YES')
else:
  print('NO')


S = input()

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

i = 0

if a == b:
  i += 1
if a == c:
  i += 1
if a == d:
  i += 1
  
if b == c:
  i += 1
if b == d:
  i += 1
if c == d:
  i += 1

if i == 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):
a = input()
a = a.replace(c[0], "")
a = a.replace(c[0], "")
if len(a) == 0:
    print("Yes")
else:
    print("No")
    

a = input()
a = a.replace(a[0], "")
if len(a) != 0:
    a = a.replace(a[0], "")
    if len(a) == 0:
        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=input()
sort_list= sorted(S)
# sort_count = sort_list.count(sort_list[0])

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

S=input()
sort_list= sorted(S)

if sort_list[0] !=sort_list[1] or sort_list[2] != sort_list[3] or sort_list[0] == sort_list[2]:
    print("No")
else:
    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):
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 = 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):
import collections as c
s=input()
a=c.Counter(s)
if a.value()==[2,2]:
  print('Yes')
else:
  print('No')

import collections as c
s=input()
a=c.Counter(s)
if a.values()==[2,2]:
  print('Yes')
else:
  print('No')

import collections as c;s=input();a=c.Counter(s);print('Yes' if str(a.values())=='dict_values([2, 2])' else '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):
import collections
S = input()
S2 = collections.counter(S)
c = True
for i,v in S2.items():
  if v == 2:
    continue
  else:
    c = False
if c:
  print('Yes')
else:
  print('No')

import collections
S = input()
S2 = collections.Counter(S)
c = True
for i,v in S2.items():
  if v == 2:
    continue
  else:
    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()
print('Yes' if len(set(s)) == 2 and s.count[s[0]] == 2 else 'No')

s = input()
print('Yes' if len(set(s)) == 2 and s.count(s[0]) == 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 = input()
lis = list(s)
count_str = 0
if s.count(lis[0]) == 2:
   count+=1
else:
    if s.count(lis[1]) == 2:
        count+=1
    else:
        if s.count(lis[2]) == 2:
            count+=1
        else if count == 3:
            print("YES")
        else:
            print("NO")

s = input()
lis = list(s)
if s.count(lis[0]) == 2:
    print("YES")
else:
    if s.count(lis[1]) == 2:
        print("YES")
    else:
        if s.count(lis[2]) == 2:
            print("YES")
        else:
            print("NO")

s = input()
lis = list(s)
count = 0
if s.count(lis[0]) == 2:
   count+=1
else:
    if s.count(lis[1]) == 2:
        count+=1
    else:
        if s.count(lis[2]) == 2:
            count+=1
        else if count == 3:
            print("YES")
        else:
            print("NO")



s = input()
lst = list(s)
for c in s:
    k = s.count(c)
    if k != 2:
        print('No')
        exit()
print('Yes')
            

Verdicts: 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] && S[2] == S[3] && S[0] != S[2]:
  print('Yes')
elif S[0] == S[2] && S[1] == S[3] && S[0] != S[1]:
  print('Yes')
elif S[0] == S[3] && S[1] == S[2] && 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

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

s = list(str(input()))
s = sorted(s)
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()
if not s[0]==s[1]==s[2]==s[3]:
    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[3]):
        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]) 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")

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())
d = sorted(list(map(int,input().split())))
print(d[n//2]-d[n//2-1])

#ABC132 = 2*2*3*11
S = input()
A = []
for i in range(len(S)):
    A.append(S[i])
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]:
    if A.count(S[0]) == 4:
        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):
s=input()
print("Yes" if (sorted(s[:2])==sorted(s[2:]) and len(sorted(s[:2))==2) else "No")


s=input()
print("Yes" if s[:2]==(s[2:] or s[2::-1]) else "No")


s=input()
print("Yes" if s[:2]==s[2:] else "No")

def resolve():
    S = set(input())
    print("Yes" if len(S) == 2 else "No")
 
resolve()

Verdicts: Runtime Error

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 defaultdict as dedict
counter = dedict(int)

a = input()
for i in list(a):
  counter[i] += 1
  
if ( len(counter) == 2) and (  counter [counter.keys()[0]] == 2):
  print ("Yes")
  
else:
  print('No')
  
  

from collections import defaultdict as dedict
counter = dedict(int)

a = input()
for i in list(a):
  counter[i] += 1
  
if ( len(counter) == 2) and (  counter [a[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):
mod = 1e9 + 7
def comb(n, r):
    if n == 0 or r == 0:
        return 1
    elif n < r:
        return 0
    else:
        m = n - r
        u = max(m, r)
        mul_sum = 1
        for j in range(u):
            loc_sum = (m - j) / (j + 1)
            mul_sum = mul_sum * loc_sum
        asr = int(mul_sum % mod)
        return asr



n, k = map(int, input().split())
ans = 0
red = n - k


for i in range(k):
    b_c = comb(k-1, i)
    r_c = comb(red+1, i+1)
    mlt = int(b_c * r_c)
    ans = mlt % mod
    print(int(ans))


S = [s for s in input()]

SS = sorted(S)

if SS[0] == SS[1] and SS[2] == SS[3] and SS[0] != SS[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(set(s))
if (len(s) != 2):
  print("NO")
else:
  print("YES")


s=input()
s=string(set(s))
if (len(s) != 2):
  print("NO")
  else:
    print("YES")

s=list(input())
s=set(s)
if (len(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()

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

s = list(input())
s.sort()
if s[0]==s[1]!=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()
count=0
first=False
OK=False
memo=S[0]
for i in range(4):    
    if S[i]==S[0]:
        count+=1
    elif (S[i]!=S[0] and first==False):
        memo=S[i]
        first=True
        print(memo)

    elif (S[i]!=S[0] and first==True):
        if S[i]==memo:
            OK=True

print(count)
print(memo)

if (count==2 and OK==True):
    print("Yes")
else:
    print("NO")

S=input()
count=0
first=False
OK=False
memo=S[0]
for i in range(4):    
    if S[i]==S[0]:
        count+=1
    elif (S[i]!=S[0] and first==False):
        memo=S[i]
        first=True
        print(memo)

    elif (S[i]!=S[0] and first==True):
        if S[i]==memo:
            OK=True

print(count)
print(memo)

if (count==2 and OK==True):
    print("Yes")
else:
    print("No")

S=input()
count=0
first=False
OK=False
memo=S[0]
for i in range(4):    
    if S[i]==S[0]:
        count+=1
    elif (S[i]!=S[0] and first==False):
        memo=S[i]
        first=True
    elif (S[i]!=S[0] and first==True):
        if S[i]==memo:
            OK=True


if (count==2 and OK==True):
    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 = sorted(list(map(int, input().split())))
print('Yes' if X[0]==X[1] and X[2]==X[3] else 'No')

S = set(input())
print('Yes' if 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):
inp=input()
ans=0
for s in inp:
  if inp.count(s)%2==2:
    ans=ans;
  else:
    ans+=1
if ans==0:
  print('Yes')
else:
  print('No')

inp=input()
ans=0
for s in inp:
  if inp.count(s)==2:
    ans=ans;
  else:
    ans+=1
if ans==0:
  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 sys import stdin
from math import factorial

if __name__ == '__main__':

    N, K = [int(x) for x in stdin.readline().rstrip().split()]

    tmp = 1000000007
    r = 0
    while True:
        r += 1
        n = N - K + 1

        if n - r < 0:
            break

        ret = factorial(n) // factorial(r) // factorial(n - r)
        ret2 = factorial(K-1) // factorial(r-1) // factorial((K - 1) - (r - 1))

        print((ret * ret2) % tmp)



from sys import stdin
from collections import Counter

S = stdin.readline().rstrip()
cnt = Counter(S)

if len(cnt.keys()) == 2 and set(cnt.values()) == {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[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] and S[2]==S[3] and S[0]!=S[2]) or (S[0]==S[2] and S[1]==S[3] and S[0]!=S[1]) or (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):
def calc(text):
  unique = list(set(text))
  if len(unique) != 2:
    return "NO"

  if text.count(unique[0]) == 2:
    return "YES"
  else:
    return "NO"

text = input()
print(calc(text))


def calc(text):
  unique = list(set(text))
  if len(unique) != 2:
    return "No"

  if text.count(unique[0]) == 2:
    return "Yes"
  else:
    return "No"

text = input()
print(calc(text))


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())
d = list(map(int,input().split()))
dunder = 0
count = 0
for i in range(max(d)):
    dunder = sum (x<i for x in d)
    if 2*dunder == len(d):
        count += 1
    elif 2*dunder > len(d):
        break
print(count)


S = input()
S = sorted(S,key=str)
if S.count(S[0]) == 2 and S[2] == S[3]:
    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 = str(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 = str(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]):
  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):
S=input()

import collections
c = collections.Counter(S).most_common()
if len(c) == 2 and c[0][1] == c[1][1]:
  print('yes')
else:
  print('no')

S=input()
 
import collections
c = collections.Counter(S).most_common()
if len(c) == 2 and c[0][1] == c[1][1]:
  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()
listS = [S[0],S[1],S[2],S[3]]
listS.sort()
if listS[0] == listS[1] and listS[2] == listS[3] and listS[2] !=listS[3]:
    print('Yes')
else:
    print('No')

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

S =input()
listS = [S[0],S[1],S[2],S[3]]
listS.sort()
if listS[0] == listS[1] and listS[2] == listS[3] and listS[1] != listS[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):
n,k = map(int, input().split())
mod = 10**9+7
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

for i in range(1,k+1):
        a = cmb(n-k+1,i)
        b = cmb(k-1,i-1)
        print((a*b)%mod)

from math import factorial
n,k = map(int, input().split())
mod = 10**9+7
# a = comb(n, r)
for i in range(1,k+1):
    if n-k+1 < i:
        print(0)
    else:
        a = factorial(n-k+1) //factorial(i) //factorial(n-k+1 - i)
        print((a*(i**(k-i)))%mod)

from math import factorial
n,k = map(int, input().split())
mod = 10**9+7
def comb(n,r):
    return factorial(n) // (factorial(r) * factorial(n - r))
# a = comb(n, r)
for i in range(1,k+1):
    if n -k + 1 >= i :
        a = comb(n-k+1,i)
        b = comb(k-1,i-1)
        print((a*b)%mod)
    else:
        print(0)

n = int(input())
p = set(map(int, input().split()))
p = list(p)
p.sort()
if len(p) % 2 == 1 and n % 2 == 1:
    print(0)
else:
    p = list(p)
    cnt = p[len(p)//2] - p[len(p)//2 -1]
    print(cnt)

s = str(input())
s1 = set(s)
s2 = list(s)
cnt = 0
if len(s1) != 2:
    print("No")
else:
    for i in range(1,len(s2)):
        if s[0] == s[i]:
            cnt += 1
    if cnt == 1:
        print("Yes")
    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):
s = input()
s.sort()
if s[0]==s[1] and s[2]==s[3]:
  print("Yes")
else:
  print("No")

S = input()
a = S[0]
b = ''
flag = 0
for i in range(1,len(S)):
  if a != b and b=='':
    b = S[i]
  elif a != b:
    flag=1
    
if flag: print("No")
else: print("Yes")

s = input()
flag = 0
if s[0]==s[1]:
  if s[2]==s[3] and s[0]!=s[2]:
    flag=1
elif s[0]==s[2]:
  if s[1]==s[3] and s[0]!=s[1]:
    flag=1
elif s[0]==s[3]:
  if s[1]==s[2] and s[0]!=s[1]:
    flag=1

if flag:
  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):
# coding: utf-8
from math import factorial
N, K = map(int, input().split())
mod = 10**9 + 7
def combination(n, r):
    if n >= r:
        return int(factorial(n) // (factorial(r) * factorial(n - r)))
    else:
        return 0

for i in range(1, K+1):
    print(combination(N-K+1, i) * combination(K-1, i-1)%mod)


# coding: utf-8
S = list(input())
if len(set(S)) == 2:
    cnt = 0
    for s in set(S):
        if S.count(s) == 2:
            cnt += 1
    if cnt == 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()
a = 0
for _ in s:
    a += 1 
if  a != 4:
    print('No')
elif 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 a[0] != s[1]:
    print('Yes')
else:
    print('No')


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


s = input()
a = s.isupper()
print (a)
if a == 'True':
    if s[0] == s[1]:
        if s[2] == s[3]:
            print ('Yes')
        else:
            print ('No')
    elif s[0] == s[2]:
        if s[1] == s[3]:
            print ('Yse')
        else:
            print ('No')
    elif s[0] == s[3]:
        if s[1] == s[2]:
            print ('Yes')
        else:
            print ('No')
    else:
        print ('No')
else:
    print ('No')


s = input()
a = 0
for _ in s:
    a += 1 
if s != 4:
    print('No')
elif s[0] == s[1] and s[1] ==s[2]:
    print('No')
elif s[0] == s[2] and s[2] == s[3]:
    print('No')
elif s[1] == s[2] and s[2] == s[3]:
    print('No')
elif s[0] == s[1] and s[1] == s[2] and 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('Yse')
elif s[0] == s[3] and s[1] == s[2]:
        print('Yes')
else:
    print('No')


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


Verdicts: Runtime Error

Runtime Error

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=str(input())
l=list(s)
l.sort()
if(l[0]==l[1] and l[2]==l[3] and l[0]!=l[2]):
  print ("YES")
else:
  print("NO")

s=str(input())
l=list(s)
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