Created
March 2, 2015 19:34
-
-
Save dcrystalj/9da20c32a17ee7d180b7 to your computer and use it in GitHub Desktop.
brdpy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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