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: Runtime Error

Solution code:

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

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
from collections import Counter
s=list(input())
L_1=Counter(s).most_common()
print("Yes" if L_1[0][1]==L_1[1][1]==2 else "No")

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
from collections import defaultdict
S = input()
t = defaultdict(int)
for i in s:
  t[i] += 1
if len(t.keys()) == 2:
  for i in t.values():
    if i != 2:
      print("No")
      break
  else:
    print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
s = input()
ans = 'No'
index = s.find(s[0], 1)
if index >= 1:
    s = s.replace(s[0], '')
    if (len(s) >= 2) & (s[0] == s[1]):
        ans ='Yes'
    
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
s1 = set(input())
if len(s1)==2:
  if s.count(list(s1)[0])==2 and s.count(list(s1)[1])==2: print('YES')
  else: print('NO')
else: print('NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
ASSS

Submission status: Runtime Error

Solution code:
from collections import Counter as C

S = input()

c = C(S)
if len(c.keys())==2:
  if c.values[0]==2:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(4100000)
s = input()
for i in range(4):
  if s[i] == s[0]:
    a += 1
  if s[i] == s[1]:
    a += 1
  if s[i] == s[2]:
    a += 1
  if s[i] == s[3]:
    a += 1
    
if a % 2 == 0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = sorted(list(map(int, input().split())))
print('Yes' if X[0]==X[1] and X[2]==X[3] else 'No')

Submission status: Runtime Error

Solution code:
s = input()
d = {}
for i in range(4):
  t = s[i:i+1]
  try:
    d[t] += 1
  except:
    d[t] = 1
if(len(d) == 2):
  frag = True
  for i in range(2):
    if(d[i] != 2):
      frag = False
  if(frag):
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from collections import defaultdict
s = str(input())
d = defaultdict(int)
for x in s:
  d[x]+=1
if len(d)==2:
  for key,value in d:
    if value!=2:
      print("No")
      exit()
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

for ss in s:
  if s.count(ss)!=2:
    print("No")
	exit()
    
print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
S1 = []
for i in S:
  if i not in S1:
    S1.append(i)
if len(S1) == 2:
  print('Yes')
else:
  prin('No')

Submission status: Runtime Error

Solution code:
N = int(input())
l = list(map(int, input().split()))

l.sort()
mid_id = int((N / 2) - 1)
ans = l[mid_id+1] - l[mid_id]

print(ans)

Submission status: Runtime Error

Solution code:
s=input()
t=set(s)
if len(t)==2:
  cnt1=0
  cnt2=0
  for i in s:
    if i==t[0]:
      cnt1+=1
      
    elif i==t[1]:
      cnt2+=1
      
  if cnt1==2 and cnt2==2:
    print('Yes')
    exit()
    
print('No')

Submission status: Runtime Error

Solution code:
print('Yes' if len(set(input()))==2, 'No')

Submission status: Runtime Error

Solution code:
S=input();s=set(S);print('NYoe s'[len(s)==2 and S.count(s[0])==2::2])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
cc = collections.Counter(raw_input())
print 'Yes' if len(cc) == 2 and cc.values() ==[2,2] else 'No'

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=input()
m=set(n)
a,b=0,0
for i in n:
    if len(m)!=2:
        print("No")
        break
    if i==m[0]:
        a+=1
    elif i==m[1]:
        b+=1
else:
    if a==2 and b==0:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
n=input()
m=set(sorted(n))
a,b=0,0
for i in n:
    if len(m)!=2:
        print("No")
        break
    if i==m[0]:
        a+=1
    elif i==m[1]:
        b+=1
else:
    if a==2 and b==0:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def main():
  s=input()
  flg=0
  if s.count(s[0])!=2:
    flg=1
  s=s.replace(s[0],'')
  if s.count(s[0])!=2:
    flg=1
  if flg==1:
    print('No')
  else:
    print('Yes')  
main()

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
s = input()
a = 0
for _ in s:
    a += 1 
if  a != 4:
    print('No')
elif s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
    print('Yes')
elif s[0] == s[2] and s[1] == s[3] and s[0] != s[1]:
    print('Yes')
elif s[0] == s[3] and s[1] == s[2] and a[0] != s[1]:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
a = []
mod = 10**9+7
for i in range(m):
    b = int(input())
    a.append(b)
d = [0 for i in range(n+1)]
d[0] = 0
d[1] = 1
d[2] = 2
for i in range(3,n+1):
    d[i] = d[i-1] + d[i-2]
ans = 1
if a[0] == 1:
    ans = 1
else:
    ans = ans*d[a[0]-1]%mod
for i in range(m-1):
    ans = ans*d[a[i+1]-a[i]-2]%mod
ans = ans*d[n-a[m-1]-1]%mod
print(ans)

Submission status: Runtime Error

Solution code:
S = list(input().rstrip())
ans = Counter(S)
print("Yes") if len(ans)==2 & list(ans.values())[0]==2 & list(ans.values())[1]==2 else print("No")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=input()
if s[1]==s[2] and s[3]==s[4]:
    print("yes")
    elif s[1]==s[3] and s[2]==s[4]:
        print("yes")
    elif s[1]==s[4] and s[2]==s[3]:
        print("yes") 
else:
    print("no")

Submission status: Runtime Error

Solution code:
s = input()
t = [s[0], s[1], s[2], s[3]]
u = list(set(t))
v = len(u)
w = s.count(u[0])
x = s.count(u[1])
if v != 2:
    print("No")
else:
    w = s.count(u[0])
    x = s.count(u[1])
    if w == 2 and x ==2:
	print("Yes")
    else:
	print("No")

Submission status: Runtime Error

Solution code:

s=list(input())
c = collections.Counter(s)
if list(c.values())==[2,2]:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s = input()
a = ''.join(sorted(s))
if a[1] == a[2] and a[3] == a[4] and a[1] != a[3]:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    s = input().rstrip()
    a = list(set(s))
    if s.count(a[0]) == s.count(a[1]) == 2:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
s=input()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input()

if a[0] == a[1] and a[2] == a[3]: //AABB
	print("Yes")
elif a[0] == a[2] and a[1] == a[3]: //ABAB
	print("Yes")
elif a[0] == a[3] and a[1] == a[2]: //ABBA
	print("Yes")
else:
  	print("No")

Submission status: Runtime Error

Solution code:
S = input()
if A == B and C == D and A != C:
  print('Yes')
elif A == C and B == D and A != B:
  print('Yes')
elif A == D and B == C and A != B:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()

orgin = set(list(s))

if len(orgin) > 2:
    print("No")
    exit()

a=0
b=0
for i in s:
    if i == origin[0]: a+=1
    elif i == origin[1]: b+=1

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

Submission status: Runtime Error

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

print("Yes" if len(d) == 2 and d.items()[0][1] == 2 else "No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=input()
ret = True
for s in a:
	sum = 0
	for t in _in:
		if s==t:
			sum += 1
	if sum != 2:
		ret = False
if ret:
	print("Yes")
else:
	print ("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=sorted(input())
s.replace(s[0],"").replace(s[2],"")

print(s)

Submission status: Runtime Error

Solution code:
s = input()

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

Submission status: Runtime Error

Solution code:
s = input()

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

Submission status: Runtime Error

Solution code:
s = input()

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

Submission status: Runtime Error

Solution code:
n = int(input())
p_list = list(map(int, input().split()))
count = 0
for i in range(1,len(p_list)-1):
    if p_list[i-1] < p_list[i] < p_list[i+1]:
        count += 1
    if p_list[i-1] > p_list[i] > p_list[i+1]:
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
S = input()

Dict = {}

for i in range(4):
  s = S[i]
  if s in Dict:
    Dict[s] += 1
  else:
    Dict[s]=1
if len(Dict)!=2:
  print("No")
else:
  if Dict[0]!=2 or Dict[1]!=2:
    print("No")
  else:
    print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = 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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
S = S.strip(S[0])

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

Submission status: Runtime Error

Solution code:
S = input()
S = S.strip(S[0])

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

Submission status: Runtime Error

Solution code:
S = input()
S.sort()
flag = True
if S[0] != S[1]:
  flag = False
if S[2] != S[3]:
  flag = False
if flag == True:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
from collections import Counter
s = input().strip()
c = Counter(s)
if c.values()[0] == 2 and c.values()[1] == 2:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
import math
#import numpy


def readints():
    return list(map(int, input().split()))


n = int(input())
p = readints()

sum = 0
for i in range(1, n-1):
    #print(p[i], end="")
    #print(p[i+1], end="")
    #print(p[i+2], end="")
    if p[i-1] < p[i] < p[i+1] or p[i-1] > p[i] > p[i+1]:
        sum += 1
print(sum)

Submission status: Runtime Error

Solution code:
import math
#import numpy


def readints():
    return list(map(int, input().split()))


n = int(input())
p = readints()
print(p)
sum = 0
for i in range(1, n-1):
    #print(p[i], end="")
    #print(p[i+1], end="")
    #print(p[i+2], end="")
    if p[i-1] < p[i] < p[i+1] or p[i-1] > p[i] > p[i+1]:
        sum += 1
print(sum)

Submission status: Runtime Error

Solution code:
import math
#import numpy


def readints():
    return list(map(int, input().split()))


n = int(input())
p = readints()
#print(p)
sum = 0
for i in range(n-2):
    #print(p[i], end="")
    #print(p[i+1], end="")
    #print(p[i+2], end="")
    if p[i] < p[i+1] < p[i+2] or p[i] > p[i+1] > p[i+2]:
        sum += 1
print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = str(input())
cnt1=0
cnt2=0
for i in range(len(S)):
    if i==0:
        list1=S[0]
        cnt1+=1
    elif i==1:
        if S[i]==list1:
            cnt1+=1
        else:
            list2=S[i]
            cnt2+=1
    else:
        if S[i]==list1:
            cnt1+=1
        elif S[i]==list2:
            cnt2+=1
        else:
            pass
if cnt1==2 and cnt2==2:
    print('Yes')
else:
    print('No')
#print(cnt1,cnt2)

Submission status: Runtime Error

Solution code:
S = str(input())
cnt1=0
cnt2=0
for i in range(len(S)):
    if i==0:
        list1=S[0]
        cnt1+=1
    elif i==1:
        if S[i]==list1:
            cnt1+=1
        else:
            list2=S[i]
            cnt2+=1
    else:
        if S[i]==list1:
            cnt1+=1
        elif S[i]==list2:
            cnt2+=1
        else:
            pass
if cnt1==2 and cnt2==2:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
sl = [*S]

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
from collections import Counter
row = sys.stdin.readline
st_ls = list(row())

print(sum([1 for i in st_ls.most_common(2) if i[1] == 2]))

Submission status: Runtime Error

Solution code:
s = int(input())

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

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
for i in range(1,4):
    if s[0] == s[i]:
        for j in range(2,4):
            if s[1] == s[j]
    else:
        print("No") 
        exit()
print("Yes")

Submission status: Runtime Error

Solution code:
s = int(input())

for i in range(1,4):
    if s[0] == s[i]:
        for j in range(2,4):
            if s[1] == s[j]
    else:
        print("No") 
        exit()
    print("Yes")

Submission status: Runtime Error

Solution code:
n, *ps = map(int, open(0).read().split())
cou =0
for x, y, z in zip(ps[:-2], ps[1:-1], ps[2:]):
  if (x-y)*(z-y)<0:
    cou += 1
print(cou)

Submission status: Runtime Error

Solution code:
n = int(input())
p = [int(_) for _ in input().split()]

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

Submission status: Runtime Error

Solution code:
s = list(input())
if len(set(a)) != 2:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()

s.sort()

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

Submission status: Runtime Error

Solution code:
def main():
	n = list(str(input()))

	n_s = sorted(n)
	elif n_s[0] == n_s[1] and n_s[2] == n_s[3] and n_s[1] != n_s[2]:
		print("Yes")
	else:
		print("No")

 
if __name__ == '__main__':
	main()

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=input()
if a[0]!=a{1}:
    if a.count(a[0])==2 and a,count(a[1])==2:
        print("yes")
    else:
        print("No")
    elif a.count(a[0])==2 and s.count(s[3])==2:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
ss = input()
set_ss = set(ss)
if len(set_ss) != 2 :
  print("No")
else:
	for s in set(ss):
    	if ss.count(s) != 2:
          print("No")
          break
    else:
    	print("Yes")

Submission status: Runtime Error

Solution code:
s = input()

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

Submission status: Runtime Error

Solution code:
s = input()

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

Submission status: Runtime Error

Solution code:
s = list(input().split())
ans="No"
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]:
	ans="Yes"
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
s = str( input() )
check = [ x == set(s)[0] for x in list(s) ]
if len( set(s) ) == 2 and sum( check ) == 2 :
   print( "Yes" )
else : 
   print( "No" )

Submission status: Runtime Error

Solution code:
s = str(input())

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

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

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

else:
    print('No')

Submission status: Runtime Error

Solution code:
s = str(input())

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

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

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

else:
    print('No')

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = list(input())
a.sort()

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

else:
    print("No")

Submission status: Runtime Error

Solution code:
a = list(input())
a.sort()

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

else:
    print("No")

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

Solution code:
#coding:utf-8
import bisect
from collections import deque
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = True

def index(a,b):
    return str(min(a,b)) + , +  str(max(a, b))

def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]

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




if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
#coding:utf-8import bisectfrom collections import dequeimport syssys.setrecursionlimit(10**6)write = sys.stdout.writedbg = lambda *something : print(*something) if DEBUG else 0DEBUG = Truedef index(a,b):    return str(min(a,b)) + , +  str(max(a, b))def main(given = sys.stdin.readline):    input = lambda : given().rstrip()    LMIIS = lambda : list(map(int,input().split()))    II = lambda : int(input())    XLMIIS = lambda x : [LMIIS() for _ in range(x)]    s = input()    if s[0] == s[1] == s[2]:        print(No)    elif s[0] == s[1] and s[2] == s[3]:        print(Yes)    elif s[0] == s[2] and s[1] == s[3]:        print(Yes)    elif s[0] == s[3] and s[1] == s[2]:        print(Yes)    else:        print(No)if __name__ == '__main__':    main()

Submission status: Runtime Error

Solution code:
ijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

Submission status: Runtime Error

Solution code:
atcoder.py

Submission status: Runtime Error

Solution code:
testtest

Submission status: Runtime Error

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