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()
ans="No"
for i in range(4):
    if s.count(s[i])==2:
        ans="Yes"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()

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

Submission status: Wrong Answer

Solution code:
S=input()
from collections import Counter
c = Counter(list(S))
cnt = 0
for char in list("abcdefghijklmnopqrstuvwxyz"):
    if c[char] == 2:
        cnt += 1
if cnt == 2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#ABC132 A

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

Submission status: Wrong Answer

Solution code:
s=input()
a=0
b=0
c=0
for i in range(1,4):
  if ord(s[0])==ord(s[i]):
    a=i
    b+=1
if b==1:
  if a==1:
    if ord(s[2])==ord(s[3]):
      print('Yes')
  elif a==2:
    if ord(s[1])==ord(s[3]):
      print('Yes')
  elif a==3:
    if ord(s[1])==ord(s[2]):
      print('Yes')
  else:
    print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
x = list(input())

a1 = (x[0] == x[2]) and (x[1] == x[3])
a2 = (x[0] == x[1]) and (x[2] == x[3])
a3 = (x[0] == x[3]) and (x[1] == x[2])

if a1 or a2 or a3:
    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[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 = 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")

Submission status: Wrong Answer

Solution code:
S = list(input())

S.sort()
#print(S)

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


else:
    print("No")

Submission status: Wrong Answer

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

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

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

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

# S_0 = S_1 かつ S_2 = S_3
# S_0 = S_2 かつ S_1 = S_3
# S_0 = S_3 かつ S_1 = 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')

Submission status: Wrong Answer

Solution code:
from collections import Counter
s = input()
x = Counter(s)
y = sorted(list(x.values()))
print(y)
if y[0]*y[-1] == 4:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
flag = False
if S[0] == S[1] and S[2] == S[3]:
    flag = True
if S[0] == S[2] and S[1] == S[3]:
    flag = True
if S[0] == S[3] and S[1] == S[2]:
    flag = True

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

Submission status: Wrong Answer

Solution code:
S = input()

flag = False
target = S[0] #1文字目固定
if target == S[1]:
    if S[2] == S[3]:
        flag = True

if target == S[2]:
    if S[1] == S[3]:
        flag = True

if target == S[3]:
    if S[1] == S[2]:
        flag = True

if flag:
    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]) or (s[0]==s[2] and s[1] ==s[3] and s[0]!=s[1])
   and (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()
st=set(s)
print(st)
if len(st)==2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()
st=set(s)
if len(st)==2:
    print("Yes")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
print("Yes" 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]) else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
S=sorted(s)
S.sort()
flag=False
if S[0]==S[1]:
    if S[2]==S[3]:
        flag=True
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし


S = LS2()
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()
print(["Bad","Yes"][len(set(s))==2 and s.count(s[0])==2])

Submission status: Wrong Answer

Solution code:
s = input()
S = list(set(s))

if s.count(S[0]) == 2 and s.count(s[1]) == 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[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()
s_tuple = tuple(s)

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

Submission status: Wrong Answer

Solution code:
s = input()
s_tuple = tuple(s)

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

Submission status: Wrong Answer

Solution code:
s=input()
ans=0
for i in range(1,4):
  if s[0]==s[i]:
    ans+=1

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

Submission status: Wrong Answer

Solution code:
s=input()
ans=0
for i in range(1,3):
  if s[0]==s[i]:
    ans+=1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

def main():
    s = input().strip()
    a = s[0] ; b = None
    c = 1 ; d = 0

    for i in range(1, 4):
        if s[i] == a:
            c += 1

        elif s[i] != a:
            b = s[i]
            d += 1

        elif s[i] == b:
            d += 1

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

main()

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:
import collections
moji=sorted(list(input()))
if moji[0]==moji[1] and moji[2]==moji[3]:
    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[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")

Submission status: Wrong Answer

Solution code:
a =input()

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

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:
S = input()
word = ""
i = 0
while i < len(S):
    if S[i] in word:
        print("Yes")
        exit()
    word = word + S[i]
    i += 1
print("No")

Submission status: Wrong Answer

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

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

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:
s=input()
a=[]
for i in s:
    if i not in a:
        a.append(i)
if len(a)<3:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:

def main():
    s = input()
    s_ = list(set(s))
    if s.count(s_[0]) == 2:
        print('Yes')
    else:
        print('No')
   

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s = input()
print(len(set(list(s))))

Submission status: Wrong Answer

Solution code:
s1,s2,s3,s4 = list(input())
p=0
if s1==s2:
    if s3!=s4:
        p=1
elif s1==s3:
    if s2!=s4:
        p=1
elif s1==s4:
    if s3!=s2:
        p=1
elif s1==s2 and s1== s3 and s1==s4:
    p=1
else:
    p=1
if p==0:
    print("Yes")
elif p==1:
    print("No")

Submission status: Wrong Answer

Solution code:
s1,s2,s3,s4 = list(input())
p=0
if s1==s2:
    if s3!=s4:
        p=1
elif s1==s3:
    if s2!=s4:
        p=1
elif s1==s4:
    if s3!=s2:
        p=1
else:
    p=1
if p==0:
    print("Yes")
elif p==1:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
print("Yes" if s[:2]==s[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[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 len(list(s))==2 and s.count(s[0])==2:print("Yes")
else:print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
result=''
count=0
for i in s:
    if result != i:
        result==i
        count+=1
        if count==2:
            print('Yes')
        else:
            print('No')

Submission status: Wrong Answer

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]


s = input()

temp = sorted(s)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input();print('NYoe s'[(len(set(s[:2]))==1 and len(set(s[2:]))==1) or (len(set(s[:2]))==2 and len(set(s[2:]))==2)::2])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

def main():

    S = input()

    listS = list(S)
    listS.sort()

    ans = 'No'
    
    if listS[0] == listS[1] and listS[2] == listS [3]:
        ans = 'Yes'

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# abc131_a.py
# https://atcoder.jp/contests/abc131/tasks/abc131_a

# A - Security /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点: 100点

# 問題文
# すぬけ君の管理する研究室の扉にはロックがかかっており、解錠にはセキュリティコードを入力する必要があります。
# セキュリティコードは 4桁の数字列です。セキュリティコードが「入力しづらい」とは、同じ数字が連続する箇所が存在することを言います。
# 現在のセキュリティコード Sが与えられます。Sが「入力しづらい」なら Bad を、そうでなければ Good を出力してください。

# 制約
#     Sは半角数字のみからなる長さ 4の文字列

# 入力
# 入力は以下の形式で標準入力から与えられます。
# S


# 出力
# セキュリティコード Sが「入力しづらい」なら Bad を、そうでなければ Good を出力してください。

# 入力例 1
# 3776

# 出力例 1
# Bad

# 2文字目と 3 文字目が同じなので、3776は入力しづらいセキュリティコードです。

# 入力例 2
# 8080

# 出力例 2
# Good

# 同じ数字が連続していないので、8080は入力しづらいセキュリティコードではありません。

# 入力例 3
# 1333

# 出力例 3
# Bad

# 入力例 4
# 0024

# 出力例 4
# Bad


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    S = lines[0]
    # N = int(lines[0])
    # X, A = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(M):
    #     valueses.append(list(map(int, lines[i+1].split())))

    result = 'Good'
    for i in range(3):
        if S[i] == S[i+1]:
            result = 'Bad'

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3776']
        lines_export = ['Bad']
    if pattern == 2:
        lines_input = ['8080']
        lines_export = ['Good']
    if pattern == 3:
        lines_input = ['1333']
        lines_export = ['Bad']
    if pattern == 4:
        lines_input = ['0024']
        lines_export = ['Bad']
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

s = input()
cnt = {l:0 for l in set(s)}
if len(cnt) != 2:
    print('No')

for l in s:
    cnt[l] += 1
    if cnt[l] > 2:
        print('No')

print('Yes')

Submission status: Wrong Answer

Solution code:
if len(input())==2:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

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:
y = "Yes"
n = "No"

S = input()

if S.count(S[0]) >= 2 and S.count(S[1]):
  print(y)
else:
  print(n)

Submission status: Wrong Answer

Solution code:
y = "Yes"
n = "No"

S = input()

if S.count(S[0]) >= 2:
  print(y)
elif S.count(S[1]) >= 2:
  print(y)
else:
  print(n)

Submission status: Wrong Answer

Solution code:
y = "Yes"
n = "No"

S = input()

if S.count(S[0]) == 2:
  print(y)
elif S.count(S[1]) == 2:
  print(y)
else:
  print(n)

Submission status: Wrong Answer

Solution code:
S=sorted(list(input()))
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]):
    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]) 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")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

flg=False
for s in ss:
  if d[s]!=2:
    flg=True
print("Yes" if flg else "No")

Submission status: Wrong Answer

Solution code:
S = input()
temp = S[0]
a = 1
b = 0
for i in range(1,4):
  if temp == S[i]:
    a = a+1
  else:
    b = b+1
if b == 2 and a == 2:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = input()
temp = S[0]
a = 1
b = 0
for i in range(1,4):
  if temp == S[0]:
    a = a+1
  else:
    b = b+1
if b == 2 and a == 2:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = list(input())
B = set(A)
for b in B:
  if A.count(b) == 2:
    print("Yes")
    exit()
print("No")

Submission status: Wrong Answer

Solution code:
A = list(input())
B = set(A)
for b in B:
  A.count(b) == 2
  print("Yes")
  exit()
print("No")

Submission status: Wrong Answer

Solution code:
S = sorted(input())
print('Yes' if set(S)==2 and S.count(S[0])==2 else '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 = list(input())
ans = "Yes"
s.sort()
if s[0] != s[1]:
    ans = "No"
elif s[2] != s[3]:
    ans = "No"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
s = input()
f = s[0]
print("YNeos"[sum(f == i for i in s) != 2::2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input()

for i in range (4):
     
   if a[0]==a[1] or a[0]==a[2] or a[0]==a[3] and a[1]==a[2] or a[1]==a[3] or a[2]==a[3]:
      print("Yes")
   else:
       print("No")
   break

Submission status: Wrong Answer

Solution code:
a = input()

for i in range (4):
   if a.islower():
     break
   elif a[0]==a[1] or a[0]==a[2] or a[0]==a[3] and a[1]==a[2] or a[1]==a[3]:
      print("Yes")
   else:
       print("No")
   break

Submission status: Wrong Answer

Solution code:
a = input()
for i in range (4):
   if a[0]==a[1] or a[0]==a[2] or a[0]==a[3] and a[1]==a[2] or a[1]==a[3]:
      print("Yes")
   else:
       print("No")
   break

Submission status: Wrong Answer

Solution code:
a = input()
for i in range (4):
  if a[0]==a[1] or a[0]==a[2] or a[0]==a[3] and a[1]==a[2] or a[1]==a[3]:
    print("Yes")
  else:
     print("No")
  break

Submission status: Wrong Answer

Solution code:
a = input()
for i in range (4):
  if a[0]==a[1] or a[0]==a[2] or a[0]==a[3]:
    print("Yes")
  elif a[1]==a[2] or a[1]==a[3]:
    print("Yes") 
  else:
     print("No")
  break

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

s = sorted(list(str(input())))

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

Submission status: Wrong Answer

Solution code:
def main():
    s = list(input())
    for i in range(3):
        if s[3] == s[i]:
            s.pop(3)
            s.pop(i)
            if s[0] == s[1]:
                print('Yes')
                return
            print('No')
            return
    print('No')
            
main()

Submission status: Wrong Answer

Solution code:
S = input('Enter S:')
 
flag = 0
if len(S) == 4:
    for i in range(len(S)-1):
        if i == 0:
            if S[i] == S[i+1] or S[i] == S[i+2] or S[i] == S[i+3]:
                flag += 1
        if i == 1:
            if S[i] == S[i+1] or S[i] == S[i+2]:
                flag += 1
        if i == 2:
            if S[i] == S[i+1]:
                flag += 1
 
    if flag > 1:
        print('Yes')
    else:
        print('No')
 
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = 'AACB'

flag = 0
if len(S) == 4:
    for i in range(len(S)-1):
        if i == 0:
            if S[i] == S[i+1] or S[i] == S[i+2] or S[i] == S[i+3]:
                flag += 1
        if i == 1:
            if S[i] == S[i+1] or S[i] == S[i+2]:
                flag += 1
        if i == 2:
            if S[i] == S[i+1]:
                flag += 1

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

else:
    print('No')

Submission status: Wrong Answer

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

def truth(x):
  count = 0
  if a ==b or a==c or a==d:
    count += 1
  if b ==c or b==d:
    count += 1
  if c ==d:
    count += 1
  if a == b == c or a == b == d or b == c == d:
    count-=1
  return count>1

if truth(a): print("Yes")
else: print("No")

Submission status: Wrong Answer

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

def truth(x):
  count = 0
  if a ==b or a==c or a==d:
    count += 1
  if b ==c or b==d:
    count += 1
  if c ==d:
    count += 1
  return count>1

if truth(a): print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
import random
k=input()
A=random.randint(0,1)
if A==1:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
a1=sys.stdin.readline()
a2=list(a1)
b=[x for x in a2]
b.sort()
if len(a2)==4 and b[0]==b[1] and b[2]==b[3] and b[1]!=b[2]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
a1=sys.stdin.readline()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if len(a2)==4 and b[0]==b[1] and b[2]==b[3] and b[1]!=b[2]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
a1=sys.stdin.readline()
t=a1.isupper()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if len(a2)==4 and t==True:
    if b[0]==b[1] and b[2]==b[3] and b[0]!=b[3] and b[1]!=b[2]:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
import sys
a1=sys.stdin.readline()
a2=list(a1)
a3 = [i for i in a1]
b=[ord(x) for x in a3]
b.sort()
if b[0]==b[1] and b[2]==b[3] and b[1]!=b[3]:
    print("Yes")
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
a1=sys.stdin.readline()
t=a1.isupper()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if len(a2)==4 and t==True:
    if b[0]==b[1] and b[2]==b[3] and b[0]!=b[3] and b[1]!=b[2]:
        print("Yes")
    else:
        print("No")
else:
    print("Error")

Submission status: Wrong Answer

Solution code:
import sys
a1=sys.stdin.readline()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if len(a2)==4 and (b[0]>=65 and b[0]<=90) and (b[1]>=65 and b[1]<=90) and (b[2]>=65 and b[2]<=90) and (b[3]>=65 and b[3]<=90):
    if b[0]==b[1] and b[2]==b[3] and b[0]!=b[3] and b[1]!=b[2]:
        print("Yes")
    else:
        print("No")
else:
    print("Error")

Submission status: Wrong Answer

Solution code:
import sys
a1=sys.stdin.readline()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if len(a2)==4:
    if b[0]==b[1] and b[2]==b[3] and b[0]!=b[3] and b[1]!=b[2]:
        print("Yes")
    else:
        print("No")
else:
    print("Error")

Submission status: Wrong Answer

Solution code:
import sys
a1=sys.stdin.readline()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if b[0]==b[1] and b[2]==b[3] and b[0]!=b[3] and b[1]!=b[2] and len(a2)==4:
    print("Yes")
elif len(a2)==4:
    print("No")
else:
    print("Error")

Submission status: Wrong Answer

Solution code:
import sys
a1=sys.stdin.readline()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if b[0]==b[1] and b[2]==b[3] and b[0]!=b[3] and b[1]!=b[2] and len(a2)==4:
    print("Yes")
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
a1=sys.stdin.readline()
a2=list(a1)
a3 = [i for i in a1]
b=[ord(x) for x in a3]
b.sort()
if b[0]==b[1] and b[2]==b[3] and b[0]!=b[3]:
    print("Yes")
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = sorted(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

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

print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    s = list(input()[:-1].decode())
    s.sort()
    if s[0] == s[1] and s[2] == s[3]:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

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

Submission status: Wrong Answer

Solution code:
S = input()
from collections import Counter
C = Counter(S)
if list(C.values())==(2,2):
  print("Yes")
else:
  print("No")