Implement an algorithm to get the median of a list of inputs based on multiple factors.
Asked in the ML coding stage. ML coding round.
Given inputs, a list of equal-length numeric factor vectors, and weights, compute each input's weighted score as the sum of value * weight for every factor. Return the median of the resulting scores. For an even number of scores, return the arithmetic mean of the two middle values.
inputs and weights are lists of numbers. Return an integer or float.
def median_by_factors(inputs, weights):