function getMinCost(crew_id, job_id) {
let cost = 0;
const sortedCrew = crew_id.sort((a, b) => a - b);
const sortedJob = job_id.sort((a, b) => a - b);
for (let i = 0; i < crew_id.length; i++) {
cost += Math.abs(sortedCrew[i] - sortedJob[i]);
}
return cost;
}