Problem:


Score : 200 points

Problem Statement

You are given strings s and t, consisting of lowercase English letters.
You will create a string s' by freely rearranging the characters in s.
You will also create a string t' by freely rearranging the characters in t.
Determine whether it is possible to satisfy s' < t' for the lexicographic order.

Notes

For a string a = a_1 a_2 ... a_N of length N and a string b = b_1 b_2 ... b_M of length M, we say a < b for the lexicographic order if either one of the following two conditions holds true:

N < M and a_1 = b_1, a_2 = b_2, ..., a_N = b_N.

There exists i (1 \leq i \leq N, M) such that a_1 = b_1, a_2 = b_2, ..., a_{i - 1} = b_{i - 1} and a_i < b_i. Here, letters are compared using alphabetical order.

For example, xy < xya and atcoder < atlas.

Constraints

The lengths of s and t are between 1 and 100 (inclusive).

s and t consists of lowercase English letters.

Input

Input is given from Standard Input in the following format:

s
t

Output

If it is possible to satisfy s' < t', print Yes; if it is not, print No.

Sample Input 1

yx
axy

Sample Output 1

Yes

We can, for example, rearrange yx into xy and axy into yxa. Then, xy < yxa.

Sample Input 2

ratcode
atlas

Sample Output 2

Yes

We can, for example, rearrange ratcode into acdeort and atlas into tslaa. Then, acdeort < tslaa.

Sample Input 3

cd
abc

Sample Output 3

No

No matter how we rearrange cd and abc, we cannot achieve our objective.

Sample Input 4

w
ww

Sample Output 4

Yes

Sample Input 5

zzz
zzz

Sample Output 5

No



Sample input:
yx
axy


Sample output:
Yes

Submission status: Runtime Error

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

sf1 = s[0]
sf2 = s[1]
tf1 = t[-1]
tf2 = t[-2]
sres1 = 0
sres2 = 0
tres1 = 0
tres2 = 0
A = "abcdefghijklmnopqrstuvwxyz"
for i,x in enumerate(A):
    if sf1 == x:
        sres1 = i
    if sf2 == x:
        sres2 = i
    if tf1 == x:
        tres1 = i
    if tf2 == x:
        tres2 = i
if sres1 < tres1:
    print("Yes")
elif sres1 == tres1:
    if sres2 < tres2:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s=list(input())
s.sort()
t=list(input())
t.sort()
 
for i in range(len(s)):
  if s[i]<t[i]:
    print('Yes')
    break
  elif s[i]==t[i]:
    continue
  else:
    print('No')
    break

Submission status: Runtime Error

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

for i in range(len(s)):
  if s[i]<t[i]:
    print('Yes')
    break
  elif s[i]==t[i]:
    pass
  else:
    print('No')
    break

Submission status: Runtime Error

Solution code:
s=list(input())
t=list(input())
for i in range(len(s)):
  if s[i]<t[i]:
    print('Yes')
    break
  elif s[i]==t[i]:
    pass
  else:
    print('No')
    break

Submission status: Runtime Error

Solution code:
print("Yes" if sorted(int(input())) < sorted(int(input()))[::-1] else "No")

Submission status: Runtime Error

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

length = min(len(s),len(t))

sorted_s = sorted(s)
soreted_t = sorted(t)[::-1]

flag = True
for i in range(length):
  if sorted_s[i] == sorted_t[i]:
    pass
  elif sorted_s[i] < sorted_t[i]:
    print('Yes')
    flag = False
    break
  else:
    print('No')
    flag = False
    break

if flag:
  if len(s) < len(t):
    print('Yse')
  else:
    print('No')

Submission status: Runtime Error

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

length = min(len(s),len(t))

sorted_s = sorted(s)
soreted_t = sorted(t)[::-1]

for i in range(length):
  if sorted_s[i] == sorted_t[i]:
    pass
  elif sorted_s[i] < sorted_t[i]:
    print('Yes')
    break
  else:
    print('No')
    break

if len(s) < len(t):
  print('Yse')
else:
  print('No')

Submission status: Runtime Error

Solution code:

  s = input()
s_asc = ''.join(sorted(s))

t = input()
t_dsc = ''.join(sorted(t, reverse = True))

if s_asc < t_dsc:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
s = sorted(list(input()))
t = sorted(list(input()), reverse = 1)
for i in range(len(s)):
    if s[i] < t[i]:
        print("Yes")
        break
else:
    if len(s) < len(t):
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
s, t = [input() for _ in range(2)]
jprint('Yes' if sorted(s) < sorted(t, reverse=True) else 'No')

Submission status: Runtime Error

Solution code:
s=sorted(input())
t=sorted(input(),reverse=True)

lista=list()

for i in s:
    c=c+i
for x in t:
    d=d+x
lista.append(c)
lista.append(d)
if s==t:
    print("No")
elif lista==sorted(lista):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s="".join(sorted(list(input())))
t="".join(sorted(list(input()),reverse=True))


if len(s)<len(t) and s==t[:len(s)]:
    print("Yes")
else:
    for i in range(len(s)):
        if s[i]!=t[i]:
            if s[i]<t[i]:
                print("Yes")
            else:
                print("No")
            break
        if i==len(s)-1:
            print("No")

Submission status: Runtime Error

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

s.sort()
s=''.join(s)#辞書順最小=辞書で一番最初

t.sort()
t.reverse()
t=''.join(t)#辞書順最大

if s<t:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
ss = ''.join(sorted(input()))
tt = ''.join(sorted(t, reverse=True))

if ss<tt:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s = input()
t = input()
alp = 'abcdefghijklmnopqrstuvwxyz'
s_li = []
for si in s:
    s_li.append(alp.find(si))
t_li = []
for ti in t:
    t_li.append(alp.find(ti))
if max(s_li) < max(t_li):
    print('Yes')
elif max(set(s_li)-set(t_li)) < max(set(t_li)-set(s_li)):
    print('Yes')
elif set(s_li) == set(t_li) and len(s_li) < len(t_li):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
s = input()
t = input()
s.sort()
t.sort()
t.reverse()
if s < t:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

print('Yes' if ''.join(sorted(s)) < ''.join(sorted(t,reverse=True) else 'No')

Submission status: Runtime Error

Solution code:
s = input()
t = input()
new_s = s.sort()
new_t = t.sort(reverse = True)
js = ''.join(new_s)
jt = ''.join(new_t)
if js > jt:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
s = list(input())
t = list(input())
new_s = s.sort()
new_t = t.sort(reverse = True)
js = ''.join(new_s)
jt = ''.join(new_t)
if js > jt:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
a=list(input())
b=lsit(input())
if a==b:
  print("No")
else:
  a.sort()
  a="".join(a)
  b.sort()
  b=b[::-1]
  b="".join(b)
  list_ = [a,b]
  list_.sort()
  if list_[0]==a:
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

Solution code:
a=input()
b=input()
if a==b:
  print("No")
else:
  a.sort()
  b.sort()[::-1]
  list_ = [a,b]
  list_.sort()
  if list_[0]==a:
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

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

t1 = sorted(t,reverse=True)
s1 = sorted(s)

print(s1,t1)
hantei = 0
count = 0

for i in range(len(s1)):
    count += 1
    if t1[i] > s1[i]:
        hantei = 1
        break
    elif t1[i] < s1[i]:
        break
    elif count == len(s1):
        hantei = 1
        break

if hantei == 1:
    print("Yes")
else:
    print("No")

if hantei == 1:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

t1 = sorted(t,reverse=True)
s1 = sorted(s)

hantei = 0

for i in range(len(s1)):
    if t1[i] > s1[i]:
        hantei = 1
        break
    elif t1[i] < s1[i]:
        break

if hantei == 1:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

s_sort = sorted(s,reverse=True)
t_sort = sorted(t,reverse= True)

if s_sort < t_sort:
    print('Yes')
else:
    print('No

Submission status: Runtime Error

Solution code:
a = input()
b = input()

c = a.sort()
d = b.sort()

if c < d:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
A = sorted(input())
B = sorted(input(), revese=True)
print("Yes" if A < B else "No")

Submission status: Runtime Error

Solution code:
A = sorted(input())
B = sorted(input(), reversed=True)
if A < B:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
s = input()
t = input()
S = ''.join(list(sorted(s)))
T = ''.join(list(sorted(t,reverse = true)))
print("Yes" if S < T else "No")

Submission status: Runtime Error

Solution code:
s = input()
t = input()
S = ''.join(sort(list(s)))
T = ''.join(reverse(list(t)))
print("Yes" if S < T else "No")

Submission status: Runtime Error

Solution code:
s = input()
t = input()
S = ''.join(reverse(list(s)))
T = ''.join(reverse(list(t)))
print("Yes" if S < T else "No")

Submission status: Runtime Error

Solution code:
s = input()
t = input()
S = ''.join(list(s).sort)
T = ''.join(list(t).reverse)
print("Yes" if S < T else "No")

Submission status: Runtime Error

Solution code:
s = [i for i in input().strip()]
t = [i for i in input().strip()]

s.sort()
t.sort(reverse=True)

#print(s)
#print(t)

for i in range(len(s)):
  if s[i] < t[i]:
    print("Yes")
    exit()
    
print("No")

Submission status: Runtime Error

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

s = sorted(s)
t = reversed(sorted(t))

if s < t:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

s.sort()
t.sort(key=lambda x:-x)

for i in range(len(t)):
  if i > len(s)-1:
    print('Yes')
    exit()
  elif s[i] == t[i]:
    continue
  elif s[i] > t[i]:
    print('No')
    exit()
  else:
    print('Yes')
    exit()
if len(t) > len(s):
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys

input = sys.stdin.readline

def main():
    s = list(input().strip())
    t = list(input().strip())
    s.sort()
    t.sort(reverse=True)

    min_len = min(len(s), len(s))
    same = True
    for i in range(min_len):
        if s[i] < t[i]:
            print("Yes")
            return
        if s[i] != t[i]:
            same = False
    if same and len(s) < len(t):
        print("Yes")
    else:
        print("No")

main()

Submission status: Runtime Error

Solution code:
s = sorted(list(input()))
t = sorted(list(input()))
ns = len(s)
nt = len(t)
can = True
if(ns<nt):
    for i in range(ns):
        if(s[i] > t[i]):
            can = False
            break
        if(s[i] < t[i]):
            can = True
            break
else:
    can = False
    for i in range(nt):
        if(s[i] > t[i]):
            can = False
            break
        if(s[i] < t[i]):
            can = True
            break
if(can):
    print('Yes')
else:
    print('No')
    A

Submission status: Runtime Error

Solution code:
s = list(input()).sort()
t = list(input()).sort()
ns = len(s)
nt = len(t)
can = True
if(ns<nt):
    for i in range(ns):
        if(s[i] > t[i]):
            can = False
            break
        if(s[i] < t[i]):
            can = True
            break
else:
    can = False
    for i in range(nt):
        if(s[i] > t[i]):
            can = False
            break
        if(s[i] < t[i]):
            can = True
            break
if(can):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
s = input().split().sort()
t = input().split().sort()
ns= len(s)
nt= len(t)
can = True
for i in range(min(ns,nt)):
    if(s[i] > t[i]):
       can = False
       break
if(can and ns < nt):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
s = list(input())
t = list(input())
s = "".join(s.sort())
t = "".join(t.sort())
ans = 'No'
if s < t:
    ans = 'Yes'
print(ans)

Submission status: Runtime Error

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

s_list = list(s)
t_list = list(t)

s_list.sort()
t_list.sort()
    
for i in range(min(len(s_list), len(t_list))):
  if s_list[i] < t_list[i]:
    print('Yes')
    break
  elif s_list[i] > t_list[i]
    print('No')
    break
  else:
    if i == min(len(s_list), len(t_list)):
      if len(s_list) < len(t_list):
        print('Yes')
      else
        print('No')
    else
      continue

Submission status: Runtime Error

Solution code:
s, t = input(), input()
s.sort()
t.sort(reverse=True)
if s < t:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
s = list(input())
t = list(input())
s = s.sort()
t = t.sort()
t = t.reverse()
s = ''.join(s)
t = ''.join(t)
if s < t:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
s = list(input())
t = list(input())
s = s.sort()
t = t.sort()
t = t.reverse()
s = ''.join(s)
t = ''.join(t)
if s < t :
  print('Yes')
else :
  print('No')

Submission status: Runtime Error

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

s = ''.join(s)
t = ''.join(t)
if s < t :
  print('Yes')
else :
  print('No')

Submission status: Runtime Error

Solution code:
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict
import math


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def mod_inv(x):
    # available only when mod is prime
    global mod
    return pow(x, mod - 2, mod)


def gcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    ret = math.factorial(x)
    ret = ret // (math.factorial(x - y) * math.factorial(y))

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


class UnionFind:

    def __init__(self, n):
        self.parent = [i for i in range(n)]

    def root(self, i):
        if self.parent[i] == i:
            return i
        self.parent[i] = self.root(self.parent[i])
        return self.parent[i]

    def unite(self, i, j):
        rooti = self.root(i)
        rootj = self.root(j)
        if rooti == rootj:
            return
        if rooti < rootj:
            self.parent[rootj] = rooti
        else:
            self.parent[rooti] = rootj

    def same(self, i, j):
        return self.root(i) == self.root(j)


###############################################################################


def main():
    s = input()
    t = input()

    slist = [c for c in s]
    tlist = [c for c in t]

    while True:
        slist.sort()
        tlist.sort(reverse=True)

        if not slist and not tlist:
            print("No")
            return
        if not slist and tlist:
            print("Yes")
            return
        if slist[0] < tlist[0]:
            print("Yes")
            return
        if slist[0] > tlist[0]:
            print("No")
            return

        del slist[0]
        del tlist[0]


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
s = input()
t = input()
s1 = [str(a) for a in s]
t1 = [str(a) for a in t]
s1.sort()
t1.sort()
import copy
t2 = copy.copy(t1)
for i in range(len(t1)):
  t1[i] = t2[len(t1)-i-1]

n = 0
l = 0
i = 0
while n==0 and i <= min(len(t),len(s)):
  if s1[i] == t1[i]:
    l = l + 1
    i = i + 1
  elif s1[i] < t1[i]:
    n = n + 1
    print('Yes')
  elif s1[i] > t1[i]:
    n = n + 1
    print('No')
if l == len(t) and len(t) <= len(s):
  print('No')
elif l == len(s) and len(s) < len(t):
  print('Yes')

Submission status: Runtime Error

Solution code:
s = input()
t = input()
s1 = [str(a) for a in s]
t1 = [str(a) for a in t]
s1.sort()
t1.sort()
import copy
t2 = copy.copy(t1)
for i in range(len(t1)):
  t1[i] = t2[len(t1)-i-1]
if len(s) < len(t):
  k = 0
  for i in range(len(s)):
    if s1[i] == t1[i]:
      k = k + 1
  if k = len(s):
    print('Yes')
  else:
    print('No')
else:
  n = 0
  l = 0
  i = 0
  while n==0 and i < len(t):
    if s1[i] == t1[i]:
      l = l + 1
      i = i + 1
    elif s1[i] < t1[i]:
      n = n + 1
      print('Yes')
    elif s1[i] > t1[i]:
      n = n + 1
      print('No')
  if l = len(t):
    print('No')

Submission status: Runtime Error

Solution code:
s = input()
t = input()
slist = []
for i in range(0, len(s)):
	slist.append(s[i])
tlist = []
for i in range(0, len(t)):
slist.sort()
tlist.sort(reverse = True)
news = ''
for i in range(0, len(slist)):
	news = news + slist[i]
newt = ''
for i in range(0, len(tlist)):
	newt = newt + tlist[i]
if news < newt: print('Yes')
else: print('No')

Submission status: Runtime Error

Solution code:
s = list(input())
t = list(input())
s.sort()
t.sort()
t.reverse()
for i in range(len(s)):
    if s[len(s)-1] == t[len(s)-1]:
        if len(s) < len(t):
            print("Yes")
        else:
            print("No")
        break
    if s[i] < t[i]:
        print("Yes")
        break
    elif s[i] == t[i]:
        continue
    else:
        print("No")
        break

Submission status: Runtime Error

Solution code:
from sys import stdin
s = "".join(sorted(list(stdin.readline().rstrip())))
t = "".join(reversed((sorted(list(stdin.readline().rstrip()))))
if s < t:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s = list(input())
t = list(input())
a = 0

s.sort()
t.sort()
t = t[::-1]

if len(s) < len(t):
    for i in range(len(s)):
        if s[i] < t[i]:
            print("Yes")
            break
        elif s[i] == t[i]:
            a += 1
            continue
        else:
            print("No")
            break
    if a == len(s):
        print("Yes")

else:
    for i in range(len(s)):
        if s[i] < t[i]:
            print("Yes")
            break
        elif s[i] == t[i]:
            a += 1
            continue
        else:
            print("No")
            break
    if a == len(s):
        print("No")

Submission status: Runtime Error

Solution code:
s=list(input())
t=list(input())
s.sort()
t.sort(reverse=True)
count=0
for i in range(len(s)):
    if s[i]==t[i]:
        count=1
        continue
    elif s[i]<t[i]:
        count=2
        break
    else:
        count=0
        break
if count==1:
    if len(s)<len(t):
        print('Yes')
    else:
        print('No')
elif count==2:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
s=list(input())
t=list(input())
s.sort()
t.sort(reverse=True)
count=0
for i in range(len(s)):
    if s[i]==t[i]:
        count+=1
        continue
    elif s[i]<t[i]:
        print('Yes')
        count=0
        break
    else:
        print('No')
        count=0
        break
if count!=0 and len(s)<len(t):
    print('Yes')
elif count!=0 and len(s)>=len(t):
    print('No')

Submission status: Runtime Error

Solution code:
import sys
s = input().sort()
t = input().sort(reverse = True)
for i in range(min(len(s),len(t))):
    if ord(s[i]) < ord(t[i]):
        print("Yes")
        sys.exit()
    elif ord(s[i]) > ord(t[i]):
        print("No")
        sys.exit()
print("Yes" if len(s) < len(t) else "No")

Submission status: Runtime Error

Solution code:
s = sorted(str(input()))
t = sorted(str(input()))[::-1]
a = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
for i in range(len(s)):
    if t[i] > s[i]:
        print("Yes")
        break
    elif len(set(s)) == len(set(t)):
        if len(s) < len(t):
            print("Yes")
            break
else:
    print("No")

Submission status: Runtime Error

Solution code:
S=input()
T=input()

s = ''.join(sorted(list(S))
t = ''.join(sorted(list(T), reverse=True))

if s < t:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
S = input()
T = input()

s1 = [ord(s) - ord('a') for s in S]
t1 = [ord(t) - ord('a') for t in T]

s1.sort()
t1.sort(reverse=True)

print(s1, t1)

for i, j in zip(s1, t1):
    if i < j:
        print('Yes')
        return

if (len(s1) < len(t1)) & (i > j):
    print('No')
    return
elif (len(s1) < len(t1)):
    print('Yes')
    return

print('No')

Submission status: Runtime Error

Solution code:
s=list(input())
t=list(input())
s.sort()
t.sort(reverse)
if s<t:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
import math

s=input()
t=input()
s=sorted(s)
t=sorted(s,reverse=True)
if s<n:
    print("Yes")
else :
    print("No")

Submission status: Runtime Error

Solution code:
import math

s=input()
t=input()
s.sort()
t.sort()
t.reverse()

s<t if print("Yes") else print("No")

Submission status: Runtime Error

Solution code:
#ABC082C
N = int(input())
remove_count = 0
number_count = 1
a = list(map(int, input().split()))
a.sort()
for i in range(N-1):
    if a[i] == a[i+1] and i > N-2:
        number_count += 1
    elif number_count < a[i]:
        remove_count += number_count
        number_count = 1      
    elif number_count > a[i]:
        remove_count += number_count - a[i]
        number_count = 1
    elif number_count == a[i]:
        number_count = 1   
                
print(remove_count)

Submission status: Runtime Error

Solution code:
A=sorted(list(input()))
B=sorted(list(input()))
if len(A)<=len(B):
    for i in range len(A)-1:
        if A(i)<=B(i):
            print("Yes")
        else:
            print("No")

Submission status: Runtime Error

Solution code:
a = input()
b = input()

a.sort()
b.sort(reverse=True)

print("Yes" if a < b else "No")

Submission status: Runtime Error

Solution code:
a = input()
b = input()

x = a.sort()
y = b.sort(reverse=True)

print("Yes" if x < y else "No")

Submission status: Runtime Error

Solution code:
s = input()
t = input()
S = []
T = []
for i in range(len(s)):
    S.append(ord(s[i:i+1]))
for i in range(len(t)):
    T.append(ord(t[i:i+1]))
S = sorted(S)
T = sorted(T, reverse=True)
for i in range(100-len(S)): 
    S.append(0)
for i in range(100-len(T)): 
    T.append(0)
for i in range(max(len(s),len(t))+1): 
    if S[i] > T[i]:
        print('No')
        break
    elif S[i] < T[i]:
        print('Yes')
        break
    elif S[i] == 0 and T[i] == 0: 
        print('No')
        break
    elif S[i] == 0: 
        print('Yes')
        break
    elif T[i] == 0: 
        print('No')
        break

Submission status: Runtime Error

Solution code:
a=input()
m=[a[i] for i in range(len(a))]
b=input()
n=[b[i] for i in range(len(b))]
m.sort()
n.sort(reverse=1)
i=0
while 1>0:
  if i==len(b):
    print("No")
    break
  if m[i]<n[i] or i==len(a):
    print("Yes")
    break
  i+=1

Submission status: Runtime Error

Solution code:
a=input()
m=[a[i] for i in range(len(a))]
b=input()
n=[b[i] for i in range(len(b))]
m.sort()
n.sort()
i=0
while 1>0:
  if m[i]<n[i]:
    print("Yes")
    break
  if i==len(a) or i==len(b):
    print("No")
    break
  i+=1

Submission status: Runtime Error

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

s.sort()
t.sort()
t.reverse()

result = ""
for i in range(len(s)):
    if s[i] < t[i]:
        result = "Yes"
        break

if result == "":
    result = "No"

print(result)

Submission status: Runtime Error

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

s_ = list(s)
t_ = list(t)

s_.sort()
t_.sort(reverce = True)

s_sorted = ""
for S in s_:
  s_sorted += S

t_sorted =""
for T in t_:
  t_stored += T

if s_sorted < t_sorted:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
s=input()
t=input()
ss=sorted(s)
tt=sorted(t,reversed)
if ss<tt:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s = list(input())
t = list(input())
s = sorted(s)
t = sorted(t,reverse=True)

for i in range(len(s)):
    if ord(s[i])<ord(t[i]):
        print("Yes")
        exit()
    elif ord(s[i])>ord(t[i]):
        print("No")
        exit()
else:
    if len(t)-len(s)>0:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
s=input()
s_=sorted(s)
s=''.join(s_)
t=input()
t_=sorted(t)
t=''.joint(t_)
if s<t:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
def two_anagrams(s: str, t: str) -> bool:
    '''s を並び替えた実現可能な最小の文字列 s' と t を並び替えて
    実現可能な最小の文字列 t' に関して、s' < t' が成り立てば良い。
    '''
    sn, tn = len(s), len(t)
    sd, td = sorted(s), sorted(t, reverse=True)

    idx = 0
    while idx < sn and idx < tn:
        # idx-1 番目の文字までは同じと仮定する。
        if sn[idx] < tn[idx]:
            # この場合 sn < tn が成り立つ。
            return True
        if sn[idx] == tn[idx]:
            # 次に持ち越し
            idx += 1
            continue
        if sn[idx] > tn[idx]:
            # この場合 sn > tn が成り立つ。
            return False

    # min(sn, tn) 番目まで同じ。あとは長いほうが後ろ
    return sn < tn


if __name__ == "__main__":
    s = input()
    t = input()
    yes = two_anagrams(s, t)
    print('Yes' if yes else 'No')

Submission status: Runtime Error

Solution code:
%%test_input https://atcoder.jp/contests/abc082/tasks/abc082_b
#B
import collections

s = str(input())
t = str(input())
sd = list(s)
td = list(t)
sd.sort()
td.sort(reverse=True)
a = ''
b = ''
for c in sd:
    a += c
for c in td:
    b += c
if sd < td:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
s = input()
t = input()
    exit()
s = list(s)
t = list(t)
s_ = sorted(s)
t_ = sorted(t)
t_.reverse()
if ''.join(s_)<''.join(t_):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
s = input()
t = input()
if s==t:
    print('No')
    exit()
s = list(s)
t = list(t)
s_ = sorted(s)
t_ = sorted(t)
t_.reverse()
print(s_)
print(t_)
for i in range(len(s_)):
    if s[i]<t[i]:
        print('Yes')
        exit()
    elif s[i]>t[i]:
        print('No')
        exit()
print('Yes')

Submission status: Runtime Error

Solution code:
import sys


def main(lines):
    s, t = lines.split('\n')

    s_ = ''
    for i in sorted(s):
        s_ += i

    t_ = ''
    for i in sorted(t, reverse=True):
        t_ += i

    if s_ < t_:
        return 'Yes'
    else:
        return 'No'


if __name__ == '__main__':
    lines_ = sys.stdin.readlines()
    ret = main(lines_)
    print(ret)

Submission status: Runtime Error

Solution code:
s=input();t=input()
s=sorted(s)
t=sorted(t)
tnew=[]

for i in range(len(t)-1,-1,-1):
    #print(i)
    tnew.append(t[i])
cnt=0

for i in range(len(s)):
    if s[i]<tnew[i]:
        print('Yes')
        cnt=1
        break
    if s[i]>tnew[i]:
        print('No')
        cnt=1
        break

if cnt==0:
    if len(tnew)>len(s):
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
s = str(input())
s = sorted([s[i] for i in range(len(s))])
t = str(input())
t = sorted([t[i] for i in range(len(t))],reverse=True)

if len(t) < len(s):
    for i in range(len(t)):
        if s[i] == t[i]:
            i += 1
        if s[i] < t[i]:
            print("Yes")
            exit()
    print("No")
else:
    s = sorted(s,reverse=True)
    for i in range(len(s)):
        if s[i] > t[i]:
            print("No")
            exit()
    print("Yes")

Submission status: Runtime Error

Solution code:
s = str(input())
s = sorted([s[i] for i in range(len(s))])
t = str(input())
t = sorted([t[i] for i in range(len(t))],reverse=True)

if len(t) < len(s):
    for i in range(len(t)):
        if s[i] == t[i]:
            i += 1
        if s[i] < t[i]:
            print("Yes")
            exit()
    print("No")
else:
    s = sorted(s,reverse=True)
    for i in range(len(s)):
        if s[i] > t[i]:

            print("No")
            exit()

    print("Yes")

Submission status: Runtime Error

Solution code:
s=sorted(list(input()))
t=sorted(list(input()))[::-1]
#print(s,t)
for i in range(len(s)):
  if(s[i]<t[i]):
    print('Yes')
    break
  elif(s[i]>t[i]):
    print('No')
    break
  else:
    if(i<len(s)-1):pass
    else:#sの長さまでは同じ。sの方が短ければYes、そうでなければNo
      if(len(s)<len(t)):
        print('Yes')
        break
      else:
        print('No')
        break

Submission status: Runtime Error

Solution code:
s=sorted(list(input()))
t=sorted(list(input()))[::-1]
#print(s,t)
for i in range(len(s)):
  if(s[i]<t[i]):
    print(s[i],t[i])
    print('Yes')
    break
  elif(s[i]>t[i]):
    print('No')
    break
  else:
    if(i<len(s)-1):pass
    else:#sの長さまでは同じ。sの方が短ければYes、そうでなければNo
      if(len(s)<len(t)):
        print('Yes')
        break
      else:
        print('No')
        break

Submission status: Runtime Error

Solution code:
s=input()
t=input()
sl = [s[i] for i in range(len(s))]
tl = [t[i] for i in range(len(t))]
n = len(sl)
m = len(tl)
sl.sort()
tl.sort(reverse=True)
flg1 = False
flg2 = False
if n < m:
    for i in range(n):
        if sl[i] != tl[i]:
            flg1 = False
            break
        flg1 = True
for i in range(n):
    if sl[i] < tl[i]:
        flg2 = True
        break
    if sl[i] > tl[i]:
        flg2 = False
        break
if flg1 or flg2:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s=input()
t=input()
sl = [s[i] for i in range(len(s))]
tl = [t[i] for i in range(len(t))]
n = len(sl)
m = len(tl)
sl.sort()
tl.sort(reverse=True)
flg = False

if n < m:
    for i in range(n):
        if sl[i] != tl[i]:
            flg = False
            break
        flg = True
for i in range(n):
    if sl[i] < tl[i]:
        flg = True
        break
if flg:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
in1.sort() = [c for c in input()]
in2.sort(reversed=1) = [c for c in input()]
print("Yes" if in1<in2 else "No")

Submission status: Runtime Error

Solution code:
print("Yes" if [c for c in input()].sort()<[c for c in input()].sort(reversed=1) else "No")

Submission status: Runtime Error

Solution code:
print("Yes" if [c for c in input()].sort()<[c for c in input()].sort(reversed=1) else "No"

Submission status: Runtime Error

Solution code:
s = input()
t = input()
s.sort()
t.sort(reverse=True)
print('Yes' if s<t else 'No')