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


if __name__ == "__main__":
    func()

Submission status: Wrong Answer

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


if __name__ == "__main__":
    func()

Submission status: Wrong Answer

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


if __name__ == "__main__":
    func()

Submission status: Wrong Answer

Solution code:
S=input()
S_list=list(S)
a=0
if S[0]==S[1]:
    if S[2]==S[3]:
        print("Yes")
        a=1
if S[0]==S[2]:
    if S[1]==S[3]:
        print("Yes")
        a=1
if S[0]==S[3]:
    if S[1]==S[2]:
        print("Yes")
        a=1
if a==0:
    print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())

try:
    s1 = s[0]
    s.remove(s1)
    s.remove(s1)
    s1 = s[0]
    s.remove(s1)
    s.remove(s1)
except ValueError:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
import sys

def mozi(S):
    s = list(S)
    s2 = list(set(s))
    if len(s2) != 2:
        ans = 'No'
        return ans
    else:
        p = 0
        q = 0
        for item in s:
            if item == s2[0]:
                p+=1
            if item == s2[1]:
                q+=1
        if p == 2 and q == 2:
            ans = 'Yes'
            return ans
        else:
            ans = 'No'
            return ans

args = sys.argv
S = args[0]
print(mozi(S))

Submission status: Wrong Answer

Solution code:
S = input()
Slist=[]
for i in range(4):
    Slist.append(S[i])
Slist.sort()

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

Submission status: Wrong Answer

Solution code:
S = input()
Slist=[]
for i in range(4):
    Slist.append(S[i])
Slist.sort()

if Slist[0] == Slist[1] and Slist[2] == Slist[3]:
    ans = "Yes"
else:
    ans = "No"

Submission status: Wrong Answer

Solution code:
S = input()


list_S=list(S)

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

Submission status: Wrong Answer

Solution code:
S = input()


list_S=list(S)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
stc = input()

chars = {}

for char in stc:
    if char in chars:
        chars[char] += 1
    else:
        chars[char] = 1

if len(chars) == 2:
    for num in chars.values():
        if num != 2:
            print('No')
            exit()

    print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()
s = []
for i in range(len(S)):
    if S[0] != S[i]:
        s.append(S[i])
if len(s) == 2:
    if s[0] == s[1]:
        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
s = []
for i in range(len(S)):
    if S[0] != S[i]:
        s.append(S[i])
if len(s) == len(S) - len(s):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
listS = list(s)
sortS = listS.sort()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(len(set(input())))

Submission status: Wrong Answer

Solution code:
n = input()
a = list(n)

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

Submission status: Wrong Answer

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

def hantei(s):
  if s[0] == s[1]:
    return True
  elif s[0] == s[2]:
    return True
  elif s[0] == s[3]:
    return True
  elif s[1] == s[2]:
    return True
  elif s[2] == s[3]:
    return True
  elif s[1] == s[3]:
    return True
  else:
    return False

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
string_set = list(set(s))
j = 0

for i in range (len(string_set)):
    if s.count(string_set[i]) == 2:
        j += 1
        continue
    else:
        print("NO")
        break
    
if len(string_set) == j:
    print("YES")

Submission status: Wrong Answer

Solution code:
input_data=input()

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

if a==b :
    if c==d and a!=c :
            output="yes"
    else :
        output="no"
    
else :
        if a==c and b==d :
            output="yes"
    
        elif a==d and b==c :
            output="yes"
        
        else :
            output="no"
           
print(output)

Submission status: Wrong Answer

Solution code:
s = sorted(input(),key=str)
if s[0] == s[1] and s[2] == s[3]:
    print("Yes")
    exit()
print("No")

Submission status: Wrong Answer

Solution code:
s = sorted(input(),key=str)
print(["No", "Yes"][s.count(s[0]) and s[2] == s[3]])

Submission status: Wrong Answer

Solution code:
s = sorted(input(),key=str)
print(["No", "Yes"][s[0] == s[1] and s[2] == s[3]])

Submission status: Wrong Answer

Solution code:
print('a')

Submission status: Wrong Answer

Solution code:
print('Yes' if len(set(input().split()))==2 else 'No')

Submission status: Wrong Answer

Solution code:
S = input()
l = [ c for c in S]
l.sort()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
  s = list(input())
  s.sort()
  if s[0] == s[1] and s[2] == s[3]: print('Yes')
  else: print('No')
    
if __name__ == "__main__":
  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:
data=input()
if data[0]==data[1] and data[2]==data[3]:
  print("Yes")
elif data[0]==data[2] and data[1]==data[3]:
  print("Yes")
elif data[0]==data[3] and data[1]==data[2]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
#abc132a

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

Submission status: Wrong Answer

Solution code:
S = input()
S = sorted(S,key=str)
if S[0] != S[1]:
    print("No")
elif S[2] == S[3]:
    print("Yes")
else :
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
se = list(set(s))
if len(se) != 2:
    print('No')
elif s.count(se[0]) == 2:
    print('No')
else:
    print('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()
flag=0

if S[0]==S[1]:
    if S[2]==S[3]:
        flag=1

if S[0]==S[2]:
    if S[1]==S[3]:
        flag=1

if S[0]==S[3]:
    if S[1]==S[2]:
        flag=1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
for i in s:
  if s.count(i)!=2:
    print("NO")
    break
else:
  print("YES")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def f_f(str):
    for s in str:
        if str.count(s) != 2:
            return False
        else:
            return True

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = input()
 
def Combination(x):
  if x[0] == x[1]:
    if x[2] == x[3]:
      return "Yes"
  elif x[0] == x[2]:
    if x[1] == x[3]:
      return "Yes"
  elif x[0] == x[3]:
    if x[1] == x[2]:
      return "Yes"
  else:
    return "No"
print(Combination(x))

Submission status: Wrong Answer

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


a=S[0]
S_rest=S[1:]

sam = [0,1,2]

judge = 0
for i in range(3):
  if a==S_rest[sam[i]]:
    judge = 1
    del sam[i]
    break
    
if judge == 0:
  print("No")
  
if judge==1:
  if S_rest[sam[0]] == S_rest[sam[1]]:
    print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()

s1 = S[0]
s2 = S[1]
s3 = S[2]
s4 = S[3]

if s1 == s2:
    if s3 == s4 and s1 != s3:
        print("Yes")
elif s2 == s3 and s1 != s4:
    if s1 == s4:
        print("Yes")
elif s1 == s3 and s1 != s2:
    if s2 == s4:
        print("Yes")
elif s1 == s4 and s1 != s2:
    if s2 == s3:
        print("Yes")
elif s2 == s4 and s1 != s2:
    if s1 == s3:
        print("Yes")
else :
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()

s1 = S[0]
s2 = S[1]
s3 = S[2]
s4 = S[3]

if s1 == s2:
    if s3 == s4:
        print("Yes")
elif s2 == s3:
    if s1 == s4:
        print("Yes")
elif s1 == s3:
    if s2 == s4:
        print("Yes")
elif s1 == s4:
    if s2 == s3:
        print("Yes")
elif s2 == s4:
    if s1 == s3:
        print("Yes")
else :
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()

s1 = S[0]
s2 = S[1]
s3 = S[2]
s4 = S[3]

if s1 == s2:
    if s3 == s4:
        print("Yes")
elif s2 == s3:
    if s1 == s4:
        print("Yes")
elif s1 == s3:
    if s2 == s4:
        print("Yes")

else :
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()

s1 = S[0]
s2 = S[1]
s3 = S[2]
s4 = S[3]

if s1 == s2:
    if s3 == s4:
        print("Yes")
elif s2 == s3:
    if s1 == s4:
        print("Yes")
else :
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=list(input())

if len(set(S)) !=2:
    print('NO')
elif S.count(S[0])==2:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
input_ = input()

input_str = set(input_)

input_str_arr = [s for s in input_str]

if input_.count(input_str_arr[0]) and input_.count(input_str_arr[0]):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = list(input())

if len(set(S)) != 2:
    print('NO')
elif S.count(S[0]) == 2:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
moji = input()

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

A = S[0]
ans = 'No'

if A == S[1]:
    B = S[2]
    if B == S[3]:
        ans = 'Yes'
else:
    B = S[1]
    if A == S[2] and B == S[3]:
        ans = 'Yes'
    if B == S[2] and A == S[3]:
        ans = 'Yes'

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

s = sorted(list(s))

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

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/abc132

s = list(str(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 = sorted(S)

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

Submission status: Wrong Answer

Solution code:
S = list(input())
S = sorted(S)

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

Submission status: Wrong Answer

Solution code:
S = list(input())
S = sorted(S)

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

Submission status: Wrong Answer

Solution code:
S = list(input())
S = sorted(S)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#ABC132A
s = input()
s_list = []
for i in range(len(s)):
    s_list.append(s[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:
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
if cnt > 2:
  ans = 0
if not ans:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
letters = list(input())
print("Yes")

Submission status: Wrong Answer

Solution code:
letters = list(input())
if letters[0] == letters[1]:
  if letters.count(letters[2]) == 2:
    ans = "Yes"
  else:
    ans = "No"
else:
  ans = "No"
print(ans)

Submission status: Wrong Answer

Solution code:
print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
print('Yes' if len(set(s)) <= 2 else 'No')

Submission status: Wrong Answer

Solution code:
s = input()
print('YES' if len(set(s)) <= 2 else 'NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
str=list(input())
if str.count(str[0])==2 and str.count(str[1])==2:
    print("Yes")
elif str.count(str[0])==2 and str.count(str[2])==2:
    print("Yes")
elif str.count(str[0])==4 or str.count(str[2])==4 or str.count(str[1])==4 or str.count(str[3])==4:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
INPUT = input()

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

Submission status: Wrong Answer

Solution code:
str=list(input())
if str.count(str[0])==2 and str.count(str[1])==2:
    print("Yes")
elif str.count(str[0])==2 and str.count(str[2])==2:
    print("Yes")
elif str.count(str[0])==4 or str.count(str[2])==4 or str.count(str[1])==4 or str.count(str[3])==4:
    print("No")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())

num = [0]*26

num_A = ord("A")

for s in S:
    num[ord(s)-num_A] += 1

if num[ord(S[0])-num_A] == 1 or num[ord(S[1])-num_A] == 1 or num[ord(S[2])-num_A] == 1 or num[ord(S[3])-num_A] == 1:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
S = list(input())

num = [0]*26

num_A = ord("A")

for s in S:
    num[ord(s)-num_A] += 1

if num[ord(S[0])-num_A] == 1 or num[ord(S[1])-num_A] == 1 or num[ord(S[2])-num_A] == 1 or num[ord(S[2])-num_A] == 1:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
S = str(input())
S_1 = 0
S_2 = 0
for i in S:
    if S_1 == 0:
        S_1 = S.count(i)

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

Submission status: Wrong Answer

Solution code:
S = str(input())
S_1 = 0
S_2 = 0
for i in S:
    if S_1 == 0:
        S_1 = S.count(i)
    else:
        S_2 = S.count(i)  

if S_1 == S_2 == 2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = str(input())
S_1 = 0
S_2 = 0
for i in range(3):
    if S_1 == 0:
        S_1 = S.count(S[i])
    else:
        S_2 = S.count(S[i])  

if S_1 == S_2 == 2:
    print('Yse')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
S_list = list(S)
print(S_list)
df = "Yes"
for i in range(0, 3):
    if S_list.count(S_list[i]) != 2:
        df = "No"
print(df)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import itertools
import sys

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


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

Submission status: Wrong Answer

Solution code:
print('YNeos'[len(set(input()))>2::2])

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
#-------------------------------------
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")

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
#-------------------------------------
s = list(input())
s.sort()
if s[0] is s[1] and s[2] is s[3] and s[1] is not 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 = str(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 = str(input())
s = list(S)
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:
print('YNeos'[len(set(input()))<2::2])

Submission status: Wrong Answer

Solution code:
def main():
    s1, s2, s3, s4 = [s for s in input()]

    if (s1 is s2) and (s3 is s4):
        print("Yes")
    elif (s1 is s3) and (s2 is s4):
        print("Yes")
    elif (s1 is s4) and (s2 is s3):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
str=list(input())
if str.count(str[0])==2 and str.count(str[1])==2:
    print("Yes")
elif str.count(str[0])==2 and str.count(str[2])==2:
    print("Yes")
elif str.count(str[0])==4 or str.count(str[2])==4:
    print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python


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


char_list = list(S)

judge = 0


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

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

Submission status: Wrong Answer

Solution code:
s = list(input())
s_set = set(s)
count = dict()
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 = str(input())
s = list(S)
if s[0] == s[1]:
    if s[2] == s[3]:
        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
string = input()
string = string.lower()
strDict = {}
for i in range(len(string)):
    if string[i] in strDict:
        strDict[string[i]] = 0
    else:
        strDict[string[i]] = 1
not_fount = True
for key, value in strDict.items():
    if value != 0:
        print("No")
        not_fount = False
        break
        
if not_fount:
    print("Yes")

Submission status: Wrong Answer

Solution code:
string = input()
strDict = {}
for i in range(len(string)):
    if string[i] in strDict:
        strDict[string[i]] = 0
    else:
        strDict[string[i]] = 1
not_fount = True
for key, value in strDict.items():
    if value != 0:
        print("No")
        not_fount = False
        break
        
if not_fount:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
b1 = ''
b2 = ''
for i, c in enumerate(s):
  if i == 0:
    b1 = c
    continue
  if c != b1 and b2 == '':
    b2 = c
    continue
  if c == b1 or c == b2:
    continue
  if c != b1 and c != b2:
    print('No')
    break
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
S = list(input())
ans = 0

for i in range(3):
    if S[i] == S[i + 1]:
        ans += 1

sorted(S)

if S[0] == S[1] == S[2] or S[1] == S[2] == S[3]:
    ans -= 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
S = raw_input()
A = []

def check():
    for i in range(len(S)):
        if S[i] in A:
            continue
        A.append(S[i])
        if len(A)==3:
            return 0
    return 1

if check()==0:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
S = list(input())

S_unique = list(set(S))

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

Submission status: Wrong Answer

Solution code:
s=input().split()
t=set(s)
if len(t)==2:
  u=list(t)
  if s.count(u[0])==2:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import sys
string = sys.stdin.readline()

if all([string.count(c)==2 for c in set(string)]) :
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if(a==b):
    count+=1
    if(c==d):
        count+=1
elif(a==c):
    count+=1
    if(b==d):
        count+=1
elif(a==d):
    count+=1
    if(b==c):
        count+=1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
string = sys.stdin.readline()

from collections import defaultdict
d = defaultdict(int)
for c in string:
    d[c] += 1
    
if list(d.values()) == [2, 2] :
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter
from operator import itemgetter, attrgetter
n=0
 
word = input()
w1=None
w2=None
isNG=False
for w in word:
    if w1 == None or w1 == w:
        w1=w
        
    else:
        if w2 == None or w2 == w:
            w2=w
        else:
            isNG = True
if isNG:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
p=str(input())
if p[0] ==p[1] ==p[2] ==p[3]:
    print("No") 
elif p[0] ==p[3] and p[1] == p[2]:
    print("Yes")
elif p[0] == p[1] and p[2] == p[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]:
  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")

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

else:
    print('No')