How would you sort using an arbitrary order?
Implement sort_by_order(items, order). items is a list of strings, and order lists distinct strings in their required priority order. Return a new list with ordered values first. Values absent from order follow in lexicographic order. Duplicate values retain their multiplicity.
Input/output: items: list[str], order: list[str] -> list[str].
Example: items = ["blue", "red", "green", "yellow", "red"], order = ["red", "green", "blue"] returns ["red", "red", "green", "blue", "yellow"].
Constraints: 0 <= len(items) <= 10^5; 0 <= len(order) <= 10^5; values are strings; order contains no duplicates.
def sort_by_order(items, order):