Skip to content

Instantly share code, notes, and snippets.

@dcrystalj
Created March 2, 2015 19:34
Show Gist options
  • Save dcrystalj/9da20c32a17ee7d180b7 to your computer and use it in GitHub Desktop.
Save dcrystalj/9da20c32a17ee7d180b7 to your computer and use it in GitHub Desktop.
brdpy
a = list(input())
b = list(input())
changed = 1
def max(arr):
m = '0'
k = 0
for i,j in enumerate(arr):
if m < j:
m = j
k = i
return (k, m)
for i,j in enumerate(a):
if changed:
(m,k) = max(b)
if k > j:
a[i] = k
b[m] = '0'
changed = 1;
else:
changed = 0
print("".join(a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment