Problem:


Score : 100 points

Problem Statement

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.

Constraints

The length of S is 4.

S consists of uppercase English letters.

Input

Input is given from Standard Input in the following format:

S

Output

If S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.

Sample Input 1

ASSA

Sample Output 1

Yes

S consists of A and S which both appear twice in S.

Sample Input 2

STOP

Sample Output 2

No

Sample Input 3

FFEE

Sample Output 3

Yes

Sample Input 4

FREE

Sample Output 4

No



Sample input:
ASSA


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
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")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
a = s[0]
b = s[1]
c = s[2]
d = s[3]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
ans = 'No'
if S[0] == S[1] and S[2] == S[3]:
  ans = 'Yes'
if S[0] == S[2] and S[1] == S[3]:
  ans = 'Yes'
if S[0] == S[3] and S[1] == S[2]:
  ans = 'Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from math import ceil, floor, sqrt
from copy import deepcopy

def main():
    flag = True
    s = input()
    c = Counter(s)
    values, counts = zip(*c.most_common())
    for i in counts:
        if (i%2 != 0):
            flag = False
    if flag:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import collections

s = input()
n = collections.Counter(s)

print('Yes' if n[s[0]] == 2 else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(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('Yse')
elif (s[0] == s[3]) and (s[1] == s[2]) and (s[0] != s[1]):
        print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(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[3]:
        print('Yse')
elif s[0] == s[3] and s[1] == s[2] and s[0] != s[1]:
        print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())
a = 0
b = s + []
for _ in b:
    a += 1 
if  a != 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')

Submission status: Wrong Answer

Solution code:
s = input()
a = 0
for _ in s:
    a += 1 
if  a != 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')

Submission status: Wrong Answer

Solution code:
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')

Submission status: Wrong Answer

Solution code:
s = input()
if 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')

Submission status: Wrong Answer

Solution code:
s = input()
if 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]:
    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')

Submission status: Wrong Answer

Solution code:
s = input()
if (s[0] == 'A' or s[0] == 'B' or s[0] == 'C' or s[0] == 'D' or s[0] == 'E' or s[0] == 'F' or s[0] == 'G' or s[0] == 'H' or s[0] == 'I' or s[0] == 'J' or s[0] == 'K' or s[0] == 'L' or s[0] == 'M' or s[0] == 'N' or s[0] == 'O' or s[0] == 'P' or s[0] == 'Q' or s[0] == 'R' or s[0] == 'S' or s[0] == 'T' or s[0] == 'U' or s[0] == 'V' or s[0] == 'W' or s[0] == 'X' or s[0] == 'Y' or s[0] == 'Z') and ('A' or s[1] == 'B' or s[1] == 'C' or s[1] == 'D' or s[1] == 'E' or s[1] == 'F' or s[1] == 'G' or s[1] == 'H' or s[1] == 'I' or s[1] == 'J' or s[1] == 'K' or s[1] == 'L' or s[1] == 'M' or s[1] == 'N' or s[1] == 'O' or s[1] == 'P' or s[1] == 'Q' or s[1] == 'R' or s[1] == 'S' or s[1] == 'T' or s[1] == 'U' or s[1] == 'V' or s[1] == 'W' or s[1] == 'X' or s[1] == 'Y' or s[1] == 'Z') and (s[2] == 'A' or s[2] == 'B' or s[2] == 'C' or s[2] == 'D' or s[2] == 'E' or s[2] == 'F' or s[2] == 'G' or s[2] == 'H' or s[2] == 'I' or s[2] == 'J' or s[2] == 'K' or s[2] == 'L' or s[2] == 'M' or s[2] == 'N' or s[2] == 'O' or s[2] == 'P' or s[2] == 'Q' or s[2] == 'R' or s[2] == 'S' or s[2] == 'T' or s[2] == 'U' or s[2] == 'V' or s[2] == 'W' or s[2] == 'X' or s[2] == 'Y' or s[2] == 'Z') and (len(s) == 4):
    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')

Submission status: Wrong Answer

Solution code:
s = input()
if (s[0] == 'A' or s[0] == 'B' or s[0] == 'C' or s[0] == 'D' or s[0] == 'E' or s[0] == 'F' or s[0] == 'G' or s[0] == 'H' or s[0] == 'I' or s[0] == 'J' or s[0] == 'K' or s[0] == 'L' or s[0] == 'M' or s[0] == 'N' or s[0] == 'O' or s[0] == 'P' or s[0] == 'Q' or s[0] == 'R' or s[0] == 'S' or s[0] == 'T' or s[0] == 'U' or s[0] == 'V' or s[0] == 'W' or s[0] == 'X' or s[0] == 'Y' or s[0] == 'Z') and ('A' or s[1] == 'B' or s[1] == 'C' or s[1] == 'D' or s[1] == 'E' or s[1] == 'F' or s[1] == 'G' or s[1] == 'H' or s[1] == 'I' or s[1] == 'J' or s[1] == 'K' or s[1] == 'L' or s[1] == 'M' or s[1] == 'N' or s[1] == 'O' or s[1] == 'P' or s[1] == 'Q' or s[1] == 'R' or s[1] == 'S' or s[1] == 'T' or s[1] == 'U' or s[1] == 'V' or s[1] == 'W' or s[1] == 'X' or s[1] == 'Y' or s[1] == 'Z') and (s[2] == 'A' or s[2] == 'B' or s[2] == 'C' or s[2] == 'D' or s[2] == 'E' or s[2] == 'F' or s[2] == 'G' or s[2] == 'H' or s[2] == 'I' or s[2] == 'J' or s[2] == 'K' or s[2] == 'L' or s[2] == 'M' or s[2] == 'N' or s[2] == 'O' or s[2] == 'P' or s[2] == 'Q' or s[2] == 'R' or s[2] == 'S' or s[2] == 'T' or s[2] == 'U' or s[2] == 'V' or s[2] == 'W' or s[2] == 'X' or s[2] == 'Y' or s[2] == 'Z'):
    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')

Submission status: Wrong Answer

Solution code:
s = input()
if (s[0] == 'A' or s[0] == 'B' or s[0] == 'C' or s[0] == 'D' or s[0] == 'E' or s[0] == 'F' or s[0] == 'G' or s[0] == 'H' or s[0] == 'I' or s[0] == 'J' or s[0] == 'K' or s[0] == 'L' or s[0] == 'M' or s[0] == 'N' or s[0] == 'O' or s[0] == 'P' or s[0] == 'Q' or s[0] == 'R' or s[0] == 'S' or s[0] == 'T' or s[0] == 'U' or s[0] == 'V' or s[0] == 'W' or s[0] == 'X' or s[0] == 'Y' or s[0] == 'Z') and ('A' or s[1] == 'B' or s[1] == 'C' or s[1] == 'D' or s[1] == 'E' or s[1] == 'F' or s[1] == 'G' or s[1] == 'H' or s[1] == 'I' or s[1] == 'J' or s[1] == 'K' or s[1] == 'L' or s[1] == 'M' or s[1] == 'N' or s[1] == 'O' or s[1] == 'P' or s[1] == 'Q' or s[1] == 'R' or s[1] == 'S' or s[1] == 'T' or s[1] == 'U' or s[1] == 'V' or s[1] == 'W' or s[1] == 'X' or s[1] == 'Y' or s[1] == 'Z') and (s[2] == 'A' or s[2] == 'B' or s[2] == 'C' or s[2] == 'D' or s[2] == 'E' or s[2] == 'F' or s[2] == 'G' or s[2] == 'H' or s[2] == 'I' or s[2] == 'J' or s[2] == 'K' or s[2] == 'L' or s[2] == 'M' or s[2] == 'N' or s[2] == 'O' or s[2] == 'P' or s[2] == 'Q' or s[2] == 'R' or s[2] == 'S' or s[2] == 'T' or s[2] == 'U' or s[2] == 'V' or s[2] == 'W' or s[2] == 'X' or s[2] == 'Y' or s[2] == 'Z'):
    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')

Submission status: Wrong Answer

Solution code:
s = input()
if (s[0] == 'A' or s[0] == 'B' or s[0] == 'C' or s[0] == 'D' or s[0] == 'E' or s[0] == 'F' or s[0] == 'G' or s[0] == 'H' or s[0] == 'I' or s[0] == 'J' or s[0] == 'K' or s[0] == 'L' or s[0] == 'M' or s[0] == 'N' or s[0] == 'O' or s[0] == 'P' or s[0] == 'Q' or s[0] == 'R' or s[0] == 'S' or s[0] == 'T' or s[0] == 'U' or s[0] == 'V' or s[0] == 'W' or s[0] == 'X' or s[0] == 'Y' or s[0] == 'Z') and ('A' or s[1] == 'B' or s[1] == 'C' or s[1] == 'D' or s[1] == 'E' or s[1] == 'F' or s[1] == 'G' or s[1] == 'H' or s[1] == 'I' or s[1] == 'J' or s[1] == 'K' or s[1] == 'L' or s[1] == 'M' or s[1] == 'N' or s[1] == 'O' or s[1] == 'P' or s[1] == 'Q' or s[1] == 'R' or s[1] == 'S' or s[1] == 'T' or s[1] == 'U' or s[1] == 'V' or s[1] == 'W' or s[1] == 'X' or s[1] == 'Y' or s[1] == 'Z') and (s[2] == 'A' or s[2] == 'B' or s[2] == 'C' or s[2] == 'D' or s[2] == 'E' or s[2] == 'F' or s[2] == 'G' or s[2] == 'H' or s[2] == 'I' or s[2] == 'J' or s[2] == 'K' or s[2] == 'L' or s[2] == 'M' or s[2] == 'N' or s[2] == 'O' or s[2] == 'P' or s[2] == 'Q' or s[2] == 'R' or s[2] == 'S' or s[2] == 'T' or s[2] == 'U' or s[2] == 'V' or s[2] == 'W' or s[2] == 'X' or s[2] == 'Y' or s[2] == 'Z'):
 #  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')

Submission status: Wrong Answer

Solution code:
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')

Submission status: Wrong Answer

Solution code:
s = input()
if (s[0] == 'A' or s[0] == 'B' or s[0] == 'C' or s[0] == 'D' or s[0] == 'E' or s[0] == 'F' or s[0] == 'G' or s[0] == 'H' or s[0] == 'I' or s[0] == 'J' or s[0] == 'K' or s[0] == 'M' or s[0] == 'N' or s[0] == 'L' or s[0] == 'O' or s[0] == 'P' or s[0] == 'Q' or s[0] == 'R' or s[0] == 'S' or s[0] == 'T' or s[0] == 'U' or s[0] == 'V' or s[0] == 'W' or s[0] == 'X' or s[0] == 'Y' or s[0] == 'Z') and ('A' or s[1] == 'B' or s[1] == 'C' or s[1] == 'D' or s[1] == 'E' or s[1] == 'F' or s[1] == 'G' or s[1] == 'H' or s[1] == 'I' or s[1] == 'J' or s[1] == 'K' or s[1] == 'M' or s[1] == 'N' or s[1] == 'L' or s[1] == 'O' or s[1] == 'P' or s[1] == 'Q' or s[1] == 'R' or s[1] == 'S' or s[1] == 'T' or s[1] == 'U' or s[1] == 'V' or s[1] == 'W' or s[1] == 'X' or s[1] == 'Y' or s[1] == 'Z') and (s[2] == 'A' or s[2] == 'B' or s[2] == 'C' or s[2] == 'D' or s[2] == 'E' or s[2] == 'F' or s[2] == 'G' or s[2] == 'H' or s[2] == 'I' or s[2] == 'J' or s[2] == 'K' or s[2] == 'M' or s[2] == 'N' or s[2] == 'L' or s[2] == 'O' or s[2] == 'P' or s[2] == 'Q' or s[2] == 'R' or s[2] == 'S' or s[2] == 'T' or s[2] == 'U' or s[2] == 'V' or s[2] == 'W' or s[2] == 'X' or s[2] == 'Y' or s[2] == 'Z'):
    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')

Submission status: Wrong Answer

Solution code:
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 ('Yse')
    else:
        print ('No')
elif s[0] == s[3]:
    if s[1] == s[2]:
        print ('Yes')
    else:
        print ('No')
else:
    print ('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
 
for i in range(3):
    if S[i] == S[i+1]:
        print("Bad")
        break
else:
    print("Good")

Submission status: Wrong Answer

Solution code:
s=input()
a=[]
for i in s:
    a.append(i)
if a[0]==a[1] and a[2]==a[3]:
    print('Yes')
elif a[0]==a[2] and a[1]==a[3]:
    print('Yes')
elif a[0]==a[3] and a[1]==a[2]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=input()
a=[]
for i in s:
    a.append(i)
if a[0]==a[1] and a[2]==a[3]:
    print('Yes')
elif a[0]==a[2] and a[1]==a[3]:
    print('Yes')
elif a[0]==a[3] and a[1]==a[2]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = str(input())
if (s[0] == s[1] and s[2] == s[3]) or (s[0] == s[3] and s[2] == s[1]) or (s[0] == s[2] and s[1] == s[3]):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
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")

Submission status: Wrong Answer

Solution code:
S=input()
cnt=[0 for _ in range(26)]
for c in S:
  cnt[ord(c)-ord('A')]+=1

  ans="Yes"
for x in cnt:
  if(x==0 or x==2):
    continue;
  else:
    ans="No"

print("Yes")

Submission status: Wrong Answer

Solution code:
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')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == '__main__':

    ABC_132_A()

Submission status: Wrong Answer

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

if __name__ == '__main__':

    ABC_132_A()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve():
    S = input()
    S = sorted(S)
    print(S)
    if S[0] == S[1] and S[2] == S[3] and S[1] != S[2]:
        print('Yes')
    else:
        print('No')


solve()

Submission status: Wrong Answer

Solution code:
def solve():
    S = input()
    S = sorted(S)
    print(S)
    if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
        print('Yes')
    else:
        print('No')


solve()

Submission status: Wrong Answer

Solution code:
def solve():
    S = input()
    S = sorted(S)
    print(S)
    if S[0] == S[1] and S[2] == S[3] and S[0] != S[1]:
        print('Yes')
    else:
        print('No')


solve()

Submission status: Wrong Answer

Solution code:
def solve():
    S = input()
    S = sorted(S)
    if S[0] == S[1] and S[2] == S[3]:
        print('Yes')
    else:
        print('No')


solve()

Submission status: Wrong Answer

Solution code:
def ABC132A(s):
    s = list(s)
    ans = True
    for i in range(len(s)):
        ans = ans and (s.count(s[i]) == 2)
    if ans:
        print("YES")
    else:
        print("NO")

ABC132A(input())

Submission status: Wrong Answer

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code

def resolve():
    S=input()
    temp=S[0]
    a=[0,0]
    for s in S:
        a[s==temp]+=1
    print(["No","Yes"][a[0]==a[1]])
#%%submit!
resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
word=input()
word=sorted(word)
print(word)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
word=input().upper()
word=sorted(word)

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

Submission status: Wrong Answer

Solution code:
word=input()
word=sorted(word)

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

Submission status: Wrong Answer

Solution code:
string=input()
string=sorted(string)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# region header
import sys
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos, pi, e
from operator import itemgetter
sys.setrecursionlimit(10**6)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
# endregion
S = Counter([i for i in rs()])
ans = 'Yes'
if len(S) != 2:
    ans = 'No'
for s in S:
    if s != 2:
        ans = 'No'
print(ans)

Submission status: Wrong Answer

Solution code:
S = list(input())
print('Yes' if len(set(S))==2 and S.count(S[0]==2) else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = str(input())
valor =1;index=0;banderita=0;array=[];m=0;igual=[];posicion=0;vacio=0
for i in range(3):
    while(valor!=4):
        if(n[index]==n[valor]):
            banderita=banderita+1
            igual.append(n[valor])
            posicion = valor
        valor=valor+1
    if(banderita==1):
        array.append(banderita)
    elif(banderita>1):
        print('No')
        break
    else:
        if(n[posicion] in igual):
            vacio=0
        else:
            print('No')
            break
    banderita=0
    index=index+1
    valor=index+1
    posicion=0
if(len(array)==2):
    print('Yes')

Submission status: Wrong Answer

Solution code:
n = str(input())
valor =1;index=0;banderita=0;array=[];m=0;igual=[];posicion=0;vacio=0
for i in range(3):
    while(valor!=4):
        if(n[index]==n[valor]):
            banderita=banderita+1
            igual.append(n[valor])
            posicion = valor
        valor=valor+1
    if(banderita==1):
        array.append(banderita)
    elif(banderita>1):
        print('No')
        break
    else:
        print(n[posicion])
        if(n[posicion] in igual):
            vacio=0
        else:
            print('No')
            break
    banderita=0
    index=index+1
    valor=index+1
    posicion=0
if(len(array)==2):
    print('Yes')

Submission status: Wrong Answer

Solution code:
S = list(str(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')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
a=s[0]
b=s[1]
c=s[2]
d=s[3]

if (a==b and c==d) or (a==c and b==d) or (a==d and b==c):
  print('Yes')
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a=input()
if (a[0]==a[1])and(a[2]==a[3]):
    print('Yes')
elif (a[0]==a[2])and(a[1]==a[3]):
    print('Yes')
elif (a[0]==a[3])and(a[1]==a[2]):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
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')

Submission status: Wrong Answer

Solution code:
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')

Submission status: Wrong Answer

Solution code:
s = input()

a = 'No'

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c, d = input()

if (a == b and c == d) or (a == c and b == d) or (a == d and b == c):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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')

Submission status: Wrong Answer

Solution code:
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]):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=str(input())

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

if a==b and b==c and c==d:
  print("NO")
elif a==b and c==d:
  print("Yes")
elif a==c and b==d:
  print("Yes")
elif a==d and b==c:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s=str(input())

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

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

Submission status: Wrong Answer

Solution code:
s = str(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')

Submission status: Wrong Answer

Solution code:
s=input()
x=s.count(s[0])
if x==2:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S=str(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")

Submission status: Wrong Answer

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

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

else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
tmp = []
for i in range(1, len(S)):
    if S[0] == S[i]:
        tmp.append(i)

if len(tmp) == 1:
    if 6-tmp[0] == 5:
        if S[2] == S[3]:
            print("Yes")

    if 6-tmp[0] == 4:
        if S[1] == S[3]:
            print("Yes")

    if 6-tmp[0] == 3:
        if S[1] == S[2]:
            print("Yes")

else:
    print("No")