We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Implementation
- Service Lane
- Discussions
Service Lane
Service Lane
Sort by
recency
|
1326 Discussions
|
Please Login in order to post a comment
n should be replaced with width. then:
def serviceLane(width, cases): return [min(width[c[0]:c[1]+1]) for c in cases]
I think the actual puzzle is fixing the code :)
Here is problem solution in Python, Java, C++, C and Javascript - https://programmingoneonone.com/hackerrank-service-lane-problem-solution.html
there is no width array being passed, you can not complete this one
the problem suck,
1.you need change the function prototype as; vector serviceLane(vector> cases, vector width) it mean that you need read the main() Legal fuction.
check from the problme description, you will think that {enter,exit} in the case is the index starting from 1, but acutally you need change it to as starting from 0 then pass.