Andela Talent Cloud needs to route requested engineering jobs to the fastest compatible machine. Given machine capabilities and completion times, return the fastest machine for every requested job.
Each machine has a unique identifier and a mapping from job names to positive completion times. A machine that does not list a job cannot process it. If multiple machines have the same minimum time, choose the machine appearing first in the input array. Return null when no machine can process a requested job.
Because the number of requested jobs can be large, build a reusable index in one pass over all machine capabilities rather than scanning every machine for every query.
Implement find_fastest_machines(machines, jobs). machines is a list of objects with an id string and a jobs dictionary mapping job-name strings to positive integers. jobs is a list of job-name strings. Return a list with one result per query, in the same order. Each available result is an object containing machine and time; unavailable jobs produce null.
def find_fastest_machines(machines, jobs):