ZhenlongDai/ACPR huggingface dataset:
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
c1=0
c2=0
c3=0
a = S[0]
b = S[1]
c = S[2]
for i in S[3:]:
    if i == a:
        c1 +=1
    elif i == b:
        c2 +=1
    elif i == c:
        c3 +=1
if c3==1 or (c1 == 1 and c2 == 1):
    print("Yes")
else:
    print("No")

Failing test case input:
ASSA

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
S = input()

s = {i for i in S}
c1=0
c2=0
if len(s) !=2:
    print("No")
else:
    a = S[0]
    b = S[1]
    for i in S[2:]:
        if i==a:
            c1 += 1
        elif i == b:
            c2 += 1
    if c1 == 2 or c2 == 2:
        print("No")
    else:
        print("Yes")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict

sent = input()
w_count = defaultdict(int)

for i in range(len(sent)):
    w_count[sent[i]] += 1

if len(set(list(w_count.values()))) == 1:
    print('Yes')
else:
    print('No')


Failing test case input:
TNPR

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from collections import defaultdict

sent = input()
w_count = defaultdict(int)

for i in range(len(sent)):
    w_count[sent[i]] += 1

result = set(list(w_count.values()))

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


s = sorted(input())

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

Failing test case input:
S@SC

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):


s = sorted(input())

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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')

Failing test case input:
FFEE

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
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')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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:
  print("NO")

Failing test case input:
EHCO

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
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")
Problem: p02987
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = input()

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


Failing test case input:
FFEE

Expected output:
Yes

Actual output:
Yes
No


Fixed submission (verdict: Accepted):
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")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
if s[0] == s[1] and s[1] == s[2]:
    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')

Failing test case input:
FFEE

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
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')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
if s.count(s[0]) == 2:
    for i in range(1, 4):
        if s[i] != s[0]:
            if s.count(s[i]) == 2:
                print('Yes')
                break
            else:
                print('No')
else:
    print('No')


Failing test case input:
RC?R

Expected output:
No


Actual output:
No
No


Fixed submission (verdict: Accepted):
s = input()
if s.count(s[0]) == 2:
    for i in range(1, 4):
        if s[i] != s[0]:
            if s.count(s[i]) == 2:
                print('Yes')
                break
            else:
                print('No')
                break
else:
    print('No')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = sorted(a)

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

Failing test case input:
SOOS

Expected output:
Yes


Actual output:
YES


Fixed submission (verdict: Accepted):
a = input()
b = sorted(a)

if b.count(b[0])==2 and b.count(b[2])==2:
  print("Yes")
else:
  print("No")
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
word_list = []
for i in range(len(s)):
    word_list.append(s[i])
list = []
print(word_list)

for i in range(len(word_list)):
    flag = 0
    w = word_list[i]
    if len(list) == 0:
        list.append([w,1])
    else:
        for j in range(len(list)+1):
            if j == len(list) and flag == 0:
                list.append([w,1])
            elif j == len(list):
                continue
            elif list[j][0] == w:
                flag = 1
                list[j][1] = list[j][1] + 1

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


Failing test case input:
ROPT

Expected output:
No


Actual output:
['R', 'O', 'P', 'T']
No


Fixed submission (verdict: Accepted):
s = input()
word_list = []
for i in range(len(s)):
    word_list.append(s[i])
list = []

for i in range(len(word_list)):
    flag = 0
    w = word_list[i]
    if len(list) == 0:
        list.append([w,1])
    else:
        for j in range(len(list)+1):
            if j == len(list) and flag == 0:
                list.append([w,1])
            elif j == len(list):
                continue
            elif list[j][0] == w:
                flag = 1
                list[j][1] = list[j][1] + 1

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = sorted(input())
ans = 'YES' if s[0] == s[1] and s[1] != s[2] and s[2] == s[3] else 'No'
print(ans)


Failing test case input:
ASSA

Expected output:
Yes

Actual output:
YES


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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
lis = list(i for i in input())
if lis.count(lis[0])==lis.count(lis[1])==lis.count(lis[2])==lis.count(lis[3]):
    print("Yes")
else:
    print("No")

Failing test case input:
PECH

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
lis = list(i for i in input())
if lis.count(lis[0])==lis.count(lis[1])==lis.count(lis[2])==lis.count(lis[3])==2:
    print("Yes")
else:
    print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    import sys
    input = sys.stdin.readline
    
    a = sorted(input())
    if a[0] == a[1] and a[2] == a[3] and a[1] != a[2]:
        print("Yes")
    else:
        print("No")
    
    return 0

main()

Failing test case input:
EEFF

Expected output:
Yes


Actual output:
No


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

main()
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict
s = input().strip()
d = defaultdict(int)
for v in s:
    d[v] += 1

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


Failing test case input:
RR@C

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from collections import defaultdict
s = input().strip()
d = defaultdict(int)
for v in s:
    d[v] += 1

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
count = 0
s1 = 0
s2 = 0
A = dict()
N = len(S)
judge = True
for i in range(N):
    if S[i] in A:
        A[S[i]] += 1
        if A[S[i]] > 2 or count > 2:
            judge = False

    else:
        A[S[i]] = 1
        count += 1
if judge:
    print('Yes')
else:
    print('No')

Failing test case input:
EDQG

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
count = 0
s1 = 0
s2 = 0
A = dict()
N = len(S)
judge = True
for i in range(N):
    if S[i] in A:
        A[S[i]] += 1
        if A[S[i]] > 2:
            judge = False

    else:
        A[S[i]] = 1
        count += 1
if count > 2:
    judge = False
    
if judge:
    print('Yes')
else:
    print('No')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")

Failing test case input:
TMOR

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
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")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=sorted(list(input()))
if S[0]==S[1] and S[1]!=S[2] and S[2]==S[3]:
    print("YES")
else:
    print("NO")

Failing test case input:
JGDP

Expected output:
No


Actual output:
NO


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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())

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


Failing test case input:
S@SC

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
S = str(input())

if S.count(S[0]) == 2:
    new_S = S.strip(S[0])
    if new_S.count(new_S[0]) == 2:
        print("Yes")
    else:
        print("No")    
else:
    print("No")
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()

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

elif s[0] == s[1] or s[0] == s[2] or s[0] == s[3]:
  if s[0] == s[1]:
    if s[2] == s[3]:
      print("Yes")
  elif  s[0] != s[1]:
    if s[1] == s[2]:
      print("Yes")
    elif  s[1] == s[3]:
      print("Yes")

else:
  print("No")

Failing test case input:
RC?R

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
s=input()

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

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

else:
  print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = sorted(list(input()))
if len(s) == 4:
    if s[0] == s[1]:
        if s[2] == s[3] and s[1] != s[2]:
            print("yes")
        else:
            print("no")

    else:
        print("no")
else:
    print("no")


Failing test case input:
PCEG

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
s = sorted(input())

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

S=input()
A=[S[0]]
for i in range(2):
    if S[i+1]!=S[i]:
        A+=S[i+1]

if len(A)!=2:
    print("No")
else:
    cou=S.count(S[0])
    if cou==2:
        print("Yes")
    else:
        print("No")

Failing test case input:
EEQG

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

S=input()
A=[S[0]]
for i in range(4):
    if S[0]!=S[i]:
        A+=S[i]
A=list(set(A))

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")
    
  

Failing test case input:
ASSA

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
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")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=list(input())
S.sort
ans = "No"
if(S[0] == S[1]) and (S[1] != S[2]) and (S[2] == S[3]):
  ans = "Yes"
print(ans)

Failing test case input:
ASSA

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
S=list(input())
S.sort()
ans = "No"
if(S[0] == S[1]) and (S[1] != S[2]) and (S[2] == S[3]):
  ans = "Yes"
print(ans)
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
str = input()

list = []
num = []

for i in str:

    if len(list) is 0:
        list.append(i)
    else:
        if list.count(i) == 0:
                list.append(i)

print(list)

for i in list:
    num.append(str.count(i))

if len(num) is 2 and num[0]==2 and num[1]==2:
    print("Yes")
else:
    print("No")
    

    








Failing test case input:
TMPR

Expected output:
No


Actual output:
['T', 'M', 'P', 'R']
No


Fixed submission (verdict: Accepted):
str = input()

list = []
num = []

for i in str:

    if len(list) is 0:
        list.append(i)
    else:
        if list.count(i) == 0:
                list.append(i)



for i in list:
    num.append(str.count(i))

if len(num) is 2 and num[0]==2 and num[1]==2:
    print("Yes")
else:
    print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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')



Failing test case input:
RPPS

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
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')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
s = [ t for t in s ]
so = set(s)
 
if len(so) == 2 and  [ s.count(c) for c in so ] == [2,2] :
  print("yes")
else:
  print("No")

print(s)

Failing test case input:
RPOS

Expected output:
No


Actual output:
No
['R', 'P', 'O', 'S']


Fixed submission (verdict: Accepted):
s = input()
s = [ t for t in s ]
so = set(s)
 
if len(so) == 2 and  [ s.count(c) for c in so ] == [2,2] :
  print("Yes")
else:
  print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



from collections import Counter


def is_valid(S):
    if len(S) != 4:
        return False

    counter = Counter(S)
    if len(counter) == 2:
        for key in counter:
            if counter[key] != 2:
                return False

    return True


def main():
    S = input()
    valid = is_valid(S)
    if valid:
        print('Yes')
    else:
        print('No')

main()



Failing test case input:
GEDQ

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):



from collections import Counter


def is_valid(S):
    if len(S) != 4:
        return False

    counter = Counter(S)
    if len(counter) == 2:
        for key in counter:
            if counter[key] != 2:
                return False
        return True
    else:
        return False


def main():
    S = input()
    valid = is_valid(S)
    if valid:
        print('Yes')
    else:
        print('No')


main()
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


def fifty_fifty(word):
    r = {}
    for s in list(word):
        if s in r:
            r[s] += 1
        else:
            r[s] = 1
    if len(r) <= 2 and max(r.values()) % 2 == 0:
        return 'yes'
    else:
        return 'no'

s = input()
print(fifty_fifty(s))

Failing test case input:
QRD?

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):


def fifty_fifty(word):
    r = {}
    for s in list(word):
        if s in r:
            r[s] += 1
        else:
            r[s] = 1
    if len(r) == 2 and max(r.values()) == 2:
        return 'Yes'
    else:
        return 'No'

s = input()
print(fifty_fifty(s))

Problem: p02987
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = list(input())
S.sort()
print(S)
if len(set(S))==2:
  if S[0]==S[1] and S[1]!=S[2] and S[2]==S[3]:
    print("Yes")
  else:
    print("No")

Failing test case input:
ASRA

Expected output:
No


Actual output:
A, A, R, S

Fixed submission (verdict: Accepted):
S = list(input())
S.sort()
if len(set(S))==2:
  if S[0]==S[1] and S[2]==S[3]:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Problem: p02987
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=input()
print(["Bad","Yes"][len(set(s))==2 and s.count(s[0])==2])

Failing test case input:
TOLR

Expected output:
No


Actual output:
Bad


Fixed submission (verdict: Accepted):
s=input()
print(["No","Yes"][len(set(s))==2 and s.count(s[0])==2])

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
s = input()
a = s[0]
if s.count(a) != 2:
  print("No")
  sys.exit()
s.replace(a,"")

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


Failing test case input:
EEQG

Expected output:
No


Actual output:
Yes


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

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = sorted(input())

print(S)

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

Failing test case input:
GEDQ

Expected output:
No


Actual output:
['D', 'E', 'G', 'Q']
No


Fixed submission (verdict: Accepted):
S = sorted(input())

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = str(input())
if s[0] == s[3] and s[1] == s[2]:
    print("Yes")
else:
    print("No")


Failing test case input:
EEFF

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = list(str(input()))
s.sort()
if s[0] == s[1] and s[2] == s[3] and not(s[0] == s[2]):
    print("Yes")
else:
    print("No")
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

Failing test case input:
GEDP

Expected output:
No


Actual output:
['D', 'E', 'G', 'P']
No


Fixed submission (verdict: Accepted):

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

letters = []
for i in range(4):
  if not s[0] in letters:
    letters.append(s[0])
  
if len(letters)==2 and letters.count(s[0])==2:
  print('Yes')
else:
  print('No')


Failing test case input:
SOOS

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = input()

letters = []
for i in range(4):
  if not s[i] in letters:
    letters.append(s[i])
  
if len(letters)==2 and s.count(s[0])==2:
  print('Yes')
else:
  print('No')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
if (S == S[::-1]):
    print(S[::-1])
    print("Yes")
else:
    if((S[0] == S[1] and S[2] == S[3]) or (S[0] == S[2] and S[1] == S[3])):
        print("Yes")
    else:
        print("No")

Failing test case input:
SOOS

Expected output:
Yes


Actual output:
['S', 'O', 'O', 'S']
Yes


Fixed submission (verdict: Accepted):
S = list(input())
if (S.count(S[0]) == 4):
    print("No")
else:
    if (S == S[::-1]):
        print("Yes")
    else:
        if (S[0] == S[1] and S[2] == S[3]) or (S[0] == S[2] and S[1] == S[3]):
            print("Yes")
        else:
            print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):





S = list(input())
count = [0, 0, 0]

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

       

print(count)

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


Failing test case input:
SBQ@

Expected output:
No


Actual output:
[0, 0, 0]
No


Fixed submission (verdict: Accepted):





S = list(input())
count = [0, 0, 0]

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

       



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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")


Failing test case input:
SONS

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
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")
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections
S = input()

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

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

Failing test case input:
OEBH

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
import collections
S = input()

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

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

Problem: p02987
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
if s[0] == s[1]:
    if s[2] == s[3]:
        print("Yes")
    else:
        print("No")
if s[0] == s[2]:
    if s[1] == s[3]:
        print("Yes")
    else:
        print("No")
if s[0] == s[3]:
    if s[1] == s[2]:
        print("Yes")
    else:
        print("No")

Failing test case input:
EHCO

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
s = input()
if 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("Yes")
    else:
        print("No")
elif s[0] == s[3]:
    if s[1] == s[2]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    s = list(input())
    s_uniq = list(set(s))*2

    a = s.sort()
    b = s_uniq.sort()

    if a == b:
        print("Yes")

    else:
        print("No")
main()


Failing test case input:
TMOR

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def main():
    s = list(input())
    s_unq = list(set(s))

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

main()

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
s_s = list(set(s))

print(s_s)

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

Failing test case input:
CHFO

Expected output:
No


Actual output:
['O', 'H', 'C', 'F']
No


Fixed submission (verdict: Accepted):
s = input()
s_s = list(set(s))

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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')

Failing test case input:
EEFF

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
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')
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

str = input() 


str_leg = len(str)



count = 0

for i in range(0, str_leg - 1):
    for j in range(i+1, str_leg):
        if (str[i] == str[j]):
             count = count + 1 

if(count == 2):
    print("Yes")
else:
     print("N0")

Failing test case input:
TMOS

Expected output:
No


Actual output:
N0


Fixed submission (verdict: Accepted):

str = input() 


str_leg = len(str)



count = 0

for i in range(0, str_leg - 1):
    for j in range(i+1, str_leg):
        if (str[i] == str[j]):
             count = count + 1 

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
list = []
for l in s:
	if l not in list:
		list.append(l)
if len(list) == 2:
	print('Yes')
else:
	print('no')

Failing test case input:
FREE

Expected output:
No

Actual output:
no


Fixed submission (verdict: Accepted):
s = input()
list = []
for l in s:
	if l not in list:
		list.append(l)
if len(list) == 2:
	if s.count(list[0]) == 2:
		print('Yes')
	else:
		print('No')
else:
	print('No')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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




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


Failing test case input:
RPPS

Expected output:
No


Actual output:
{'S', 'R', 'P'}
No


Fixed submission (verdict: Accepted):

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





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

Problem: p02987
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
cnt = 1
ans = 1
for i in range(1, 4):
  if s[i - 1] != s[i]:
    if cnt < 2:
      ans = 0
      break
    cnt = 1
  if not ans:
    break
if cnt > 2:
  ans = 0
if not ans:
  print("No")
else:
  print("Yes")

Failing test case input:
EEFF

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = list(input())
s.sort()
cnt = 1
ans = 1

for i in range(1, 4):
  
  if s[i - 1] != s[i]:
    if cnt < 2:
      ans = 0
      break
    cnt = -1
  if not ans:
    break
  cnt += 1
if cnt > 3:
  ans = 0
if not ans:
  print("No")
else:
  print("Yes")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(input())
before = -1
count =0
for char in a:
    current = char
    if before == current:
        count = count+1
    else:
        before = current

if count==2:
    s = set()
    for item in a:
        s.add(item)
    if len(s) == 2:
        print("Yes")
        exit()

print("No")

Failing test case input:
SOOS

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
a = list(input())
before = -1
count =0
for char in a:
    current = char
    if before == current:
        count = count+1
    else:
        before = current

if count<=2:
    s = set()
    for item in a:
        s.add(item)
    if len(s) == 2:
        print("Yes")
        exit()

print("No")
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

S=input()
A=[S[0]]
for i in range(3):
    if S[0]!=S[i]:
        A+=S[i]
A=list(set(A))

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

Failing test case input:
RR@C

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

S=input()
A=[S[0]]
for i in range(4):
    if S[0]!=S[i]:
        A+=S[i]
A=list(set(A))

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")


Failing test case input:
EEQG

Expected output:
No


Actual output:
2 2 1 1
No


Fixed submission (verdict: Accepted):
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")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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')  
    

Failing test case input:
RQ?C

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
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')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = input()
chars = list(x)
a = ord(chars[0])
b = ord(chars[1])
c = ord(chars[2])
d = ord(chars[3])
if (a==b and c==d and a!=c) or (a==c and b==d and a!=b) or (a==d and b==c and a!=b):
  print("yes")
else:
  print("no")



Failing test case input:
PECH

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
x = input()
chars = list(x)
a = ord(chars[0])
b = ord(chars[1])
c = ord(chars[2])
d = ord(chars[3])
if (a==b and c==d and a!=c) or (a==c and b==d and a!=b) or (a==d and b==c and a!=b):
  print("Yes")
else:
  print("No")
Problem: p02987
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()

appearence = {}

for char in S:
    print(char)
    if char not in appearence:
        appearence[char] = 1
    else:
        appearence[char] += 1

if len(appearence) == 2 and all(2 == value for value in appearence.values()):
    print('Yes')
else:
    print('No')


Failing test case input:
CHEO

Expected output:
No


Actual output:
C
H
E
O
No


Fixed submission (verdict: Accepted):
S = input()

appearence = {}

for char in S:
    if char not in appearence:
        appearence[char] = 1
    else:
        appearence[char] += 1

if len(appearence) == 2 and all(2 == value for value in appearence.values()):
    print('Yes')
else:
    print('No')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

letters = []
for i in range(4):
  if not s[i] in letters:
    letters.append(s[i])
  
if len(letters)==2 and s.count(s[0])==2:
  print('Yes')
else:
  print('No')

print(letters)

Failing test case input:
TPOQ

Expected output:
No


Actual output:
No
['T', 'P', 'O', 'Q']


Fixed submission (verdict: Accepted):
s = input()

letters = []
for i in range(4):
  if not s[i] in letters:
    letters.append(s[i])
  
if len(letters)==2 and s.count(s[0])==2:
  print('Yes')
else:
  print('No')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections
s = input()
s = list(s)
s.sort()
count = 0
ans = collections.Counter(s)
ans = len(ans)
if ans == 2:
    print("YES")
else:
    print("NO")

Failing test case input:
EQ?R

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
import collections
s = input()
s = list(s)
s.sort()
count = 0
ans = collections.Counter(s)
ans = len(ans)
if ans == 2:
    print("Yes")
else:
    print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
listS = list(s)
sortS = listS.sort()
output = 'NO'
if listS[0] == listS[1] and listS[2] == listS[3]:
  if listS[0] != listS[3]:
    output = 'Yes'
print(output)

Failing test case input:
HFOC

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
s = input()
listS = list(s)
sortS = listS.sort()
if listS[0] == listS[1] and listS[2] == listS[3]:
  if listS[0] != listS[3]:
    print('Yes')
  else:
    print('No')
else:
  print('No')
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = dict()
b = list(input())
s1 = "random"
s2 = "random"
x = 0
y = 0
for i in b:
    if i == s1:
        x += 1
    elif i == s2:
        y += 1
    else:
        if s1 == "random":
            s1 = i
            x += 1
        else:
            s2 = i
            y += 1
if x == 2 and y == 2:
    print("Yes")
else:
    print("No")

Failing test case input:
RR@C

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a = dict()
b = list(input())
s1 = "random"
s2 = "random"
x = 0
y = 0
for i in b:
    if i == s1:
        x += 1
    elif i == s2:
        y += 1
    else:
        if s1 == "random":
            s1 = i
            x += 1
        elif s2 == "random":
            s2 = i
            y += 1
if x == 2 and y == 2:
    print("Yes")
else:
    print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
print('Yes' if (s[0] == s[2] and s[1] == s[3]) or (s[1] == s[2] and s[0] == s[3]) else 'No')


Failing test case input:
FFEE

Expected output:
Yes

Actual output:
No


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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    a= input()
    print(a)

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


if __name__ == "__main__":
    main()

Failing test case input:
D?RQ

Expected output:
No


Actual output:
D?RQ
No


Fixed submission (verdict: Accepted):
def main():
    a= input()

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


if __name__ == "__main__":
    main()

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=str(input())
a=0
for i in S:
  if S.count(i)==2:
    a+=2
    
print('Yes' if a==4 else 'No')

Failing test case input:
ASSA

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
S=str(input())
a=0
for i in S:
  if S.count(i)==2:
    a+=1
    
print('Yes' if a==4 else 'No')
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
if S[0]==S[1]:
    if S[0]!=S[2] and S[2]==S[3]:
        print('Yes')
elif S[0]==S[2]:
    if S[0]!=S[1] and S[1]==S[3]:
        print('Yes')
elif S[0]==S[3]:
    if S[0]!=S[1] and S[1]==S[2]:
        print('Yes')
else:
    print('No')

Failing test case input:
SONS

Expected output:
No


Actual output:

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S   =   input()

for i in range(int(len(S)/2)):
    if(S.count(S[i]) !=2 ):
        print("No")
        exit()
print("Yes")


Failing test case input:
EEQF

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S   =   input()

for i in range(int(len(S))):
    if(S.count(S[i]) !=2 ):
        print("No")
        exit()
print("Yes")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections
S=list(map(str,input()))

S=collections.Counter(S)
a=S.most_common()

print(a[0][0])

if int(len(a)) is 2:
    print("Yes")

else:
    print("No")

Failing test case input:
EEFF

Expected output:
Yes


Actual output:
E
Yes


Fixed submission (verdict: Accepted):
import collections
S=list(map(str,input()))

S=collections.Counter(S)
a=S.most_common()



if int(len(a)) is 2:
    print("Yes")

else:
    print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")

Failing test case input:
TPOQ

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
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")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = str(input())
x = {}
for i in range(4):
  if s[i] not in x.keys():
    x[s[i]] = 1
  else:
    x[s[i]] += 1
for i in x.items():
  if i != 2:
    print("No")
    exit()
print("Yes")
    

Failing test case input:
SOOS

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = str(input())
x = {}
for i in range(4):
  if s[i] not in x.keys():
    x[s[i]] = 1
  else:
    x[s[i]] += 1
for i in x.values():
  if i != 2:
    print("No")
    exit()
print("Yes")
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
S1 = sorted(S)

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


Failing test case input:
SOOS

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
S = list(input())
S1 = sorted(S)

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
inputs_array = list(input())
check_dict = {}

is_words = False
is_two = True

for later in inputs_array:
  if later in check_dict:
    check_dict[later] += 1
  else:
    check_dict[later] = 1
    
for v in check_dict:
  if check_dict[v] == 2:
    continue
  else:
    is_two = False
    break

if len(check_dict) == 2:
  is_words = True
  
if is_words and is_two:
  print('YES')
else:
  print('NO')

Failing test case input:
PCDG

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
inputs_array = list(input())
check_dict = {}

is_words = False
is_two = True

for later in inputs_array:
  if later in check_dict:
    check_dict[later] += 1
  else:
    check_dict[later] = 1
    
for v in check_dict:
  if check_dict[v] == 2:
    continue
  else:
    is_two = False
    break

if len(check_dict) == 2:
  is_words = True
  
if is_words and is_two:
  print('Yes')
else:
  print('No')

Problem: p02987
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a =input()

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

Failing test case input:
ASSA

Expected output:
Yes

Actual output:
No


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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = sorted(input())

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


Failing test case input:
RPNT

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
s = sorted(input())

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")

Failing test case input:
GEDP

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
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")
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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:
            break
    else:
        print("Yes")
else:
    print("No")


Failing test case input:
SMOS

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
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")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = sorted(input())
print("YES" if s[0] == s[1] and s[2] == s[3] and s[1] != s[2] else "NO")

Failing test case input:
SOMT

Expected output:
No


Actual output:
NO


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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
if S[0]==S[1]:
    if S[0]!=S[2] and S[2]==S[3]:
        print('Yes')
elif S[0]==S[2]:
    if S[0]!=S[1] and S[1]==S[3]:
            print('Yes')
elif S[0]==S[3]:
    if S[0]!=S[1] and S[1]==S[2]:
        print('Yes')
else:
    print('No')

Failing test case input:
SMOS

Expected output:
No


Actual output:

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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')

Failing test case input:
DRQ?

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
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')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def f_f(str):
    for s in str:
        if str.count(s) != 2:
            return False
        else:
            return True

S = input()
if f_f(S):
    print("Yes")
else:
    print("No")


Failing test case input:
RR@C

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def f_f(str):
    for s in str:
        if str.count(s) != 2:
            return False
    return True
 
S = input()
if f_f(S):
    print("Yes")
else:
    print("No")
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=str(input())
lst=list(s)
lst.sort()
result = True

if lst[0] == lst[1]:
    if lst[2] == lst[3]:
        result = False

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

Failing test case input:
SOOS

Expected output:
Yes


Actual output:
YES


Fixed submission (verdict: Accepted):
s=str(input())
lst=list(s)
lst.sort()
result = False

if lst[0] == lst[1]:
    if lst[1] != lst[2]:
        if lst[2] == lst[3]:
            result = True

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
list=[S[0],S[1],S[2],S[3]]
if list.count(S[0])==list.count(S[1])==list.count(S[2])==list.count(S[3])=='2':
  print('Yes')
else:
  print('No')

Failing test case input:
EEFF

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
S=input()
list=[S[0],S[1],S[2],S[3]]
if list.count(S[0])==list.count(S[1])==list.count(S[2])==list.count(S[3])==2:
  print('Yes')
else:
  print('No')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=list(input())
ans = "No"
if(S[0] == S[1]) and (S[1] != S[2]) and (S[2] == S[3]):
  ans = "Yes"
print(ans)

Failing test case input:
ASSA

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
S=list(input())
S.sort()
ans = "No"
if(S[0] == S[1]) and (S[1] != S[2]) and (S[2] == S[3]):
  ans = "Yes"
print(ans)

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

Failing test case input:
S@QB

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):

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

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
if set(input()) == 2:
  print('Yes')
else:
  print('No')

Failing test case input:
ASSA

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
if len(set(input())) == 2:
  print('Yes')
else:
  print('No')

Problem: p02987
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s=input()
count1=0
count2=0

char1=s[0]
char2='1'
count1+=1
if s[1]==char1:
    count1+=1
else :
    char2=s[1]
    count2+=1

if s[2]==char1:
    count1+=1
elif '1'==char2:
    char2=s[2]
    count2+=1

if s[3]==char1:
    count1+=1
elif '1'==char2:
    char2=s[3]
    count2+=1
elif s[3]==char2:
    count2+=1

if count1==2 and count2==2:
    print('Yes')
else:
    print('No')



Failing test case input:
ASSA

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s=input()
count1=0
count2=0

char1=s[0]
char2='1'
count1+=1
if s[1]==char1:
    count1+=1
else :
    char2=s[1]
    count2+=1

if s[2]==char1:
    count1+=1
elif '1'==char2:
    char2=s[2]
    count2+=1
elif s[2]==char2:
    count2+=1

if s[3]==char1:
    count1+=1
elif '1'==char2:
    char2=s[3]
    count2+=1
elif s[3]==char2:
    count2+=1

if count1==2 and count2==2:
    print('Yes')
else:
    print('No')