b = ['b1', 'b2', 'b3']
a = ['b1', 'x', 'b3', 'y', 'b2']
solve(a, b)
a = ['b1', 'x', 'b2', 'y', 'b3']
solve(a, b)
a = ['b1', 'x', 'y', 'b2']
solve(a, b)
a = ['b3', 'x', 'b1', 'y', 'b2']
solve(a, b)
Sort a subset of a python list to have the same relative order as in other list