Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- first_lst = [int(i) for i in input().split(',')]
- second_lst = [int(i) for i in input().split(',')]
- new_set = len(first_lst) * [-1]
- for i in range(len(first_lst)):
- for j in range(len(second_lst)):
- if first_lst[i] == second_lst[j]:
- for k in range(j+1, len(second_lst)):
- if second_lst[k] > first_lst[i]:
- new_set[i] = second_lst[k]
- break
- print(','.join(str(i) for i in new_set))
Advertisement
Add Comment
Please, Sign In to add comment