# your code goes here from itertools import product from random import randint def mix(first,second): my_gen = product(first,second) for el in my_gen: if el[0] == el[1]: del first[first.index(el[0])], second[second.index(el[0])] return mix(first,second) return first+second seq1 = [randint(0,10) for i in range(randint(20,100))] seq2 = [randint(0,10) for i in range(randint(20,100))] print(seq1) print(seq2) x = mix(seq1,seq2) print(x)
Standard input is empty
[8, 7, 3, 8, 7, 1, 4, 6, 7, 9, 8, 6, 9, 0, 6, 8, 2, 3, 6, 2, 10, 10, 2, 9, 5, 2, 3, 3, 3, 2] [0, 2, 5, 3, 5, 9, 4, 4, 4, 7, 1, 9, 4, 0, 8, 4, 4, 6, 2, 1, 0, 1, 0, 5, 5, 1, 4, 8, 5, 8, 7, 1, 4, 5, 6, 7, 5, 8, 9, 9, 8, 7, 3, 6, 7, 9, 2, 2, 3, 2, 7, 10, 1] [6, 10, 3, 3, 5, 4, 4, 4, 0, 4, 4, 1, 0, 1, 0, 5, 5, 1, 4, 5, 1, 4, 5, 5, 9, 8, 7, 7, 9, 7, 1]