• + 0 comments

    JS Solution :

    function serviceLane(n, cases, width) {
        // Write your code here
        return cases.map(cs => {
            const slicedWidth = width.slice(cs[0], cs[1] + 1)
            return slicedWidth.sort((a, b) => a - b)[0]
        })
    }