You are viewing a single comment's thread. Return to all comments →
Typescript minimal solution (I had to fix the function since it missed the width param):
function serviceLane(cases: number[][], width: number[]): number[] { const results = [].constructor(cases.length); cases.forEach((c, index) => { results[index] = width[c[0]]; for (let i = c[0]; i <= c[1]; i++) { if (results[index] > width[i]) results[index] = width[i]; } }); return results; }
Seems like cookies are disabled on this browser, please enable them to open this website
Service Lane
You are viewing a single comment's thread. Return to all comments →
Typescript minimal solution (I had to fix the function since it missed the width param):