Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - A = list(map(int, input().split()))
 - B = list(map(int, input().split()))
 - i = 0
 - j = 0
 - S = []
 - while i < len(A) and j < len(B):
 - if A[i] < B[j]:
 - S.append(A[i])
 - if i == len(A) - 1:
 - S += B[j::]
 - i += 1
 - else:
 - S.append(B[j])
 - if j == len(B) - 1:
 - S += A[i::]
 - j += 1
 - print(*S)
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment