Find the Output

Explaination

Find the Output

Explaination

Service Lane

A driver is driving on the freeway. The check engine light of his vehicle is on, and the driver wants to get service immediately. Luckily, a service lane runs parallel to the highway. It varies in width along its length.

You will be given an array of widths at points along the road (indices), then a list of the indices of entry and exit points. Considering each entry and exit point pair, calculate the maximum size vehicle that can travel that segment of the service lane safely.

Function Description
Complete the serviceLanne function
serviceLane has the following parameter(s)

1.int n: the size of the width array
2.int cases[t][2]: each element contains the starting and ending indices for a segment to consider, inclusive

Try Now

Find the Output

Explaination

Find the Output

Explaination