Somehow, this test suite has changed and now I cannot pass Test 62, even though I did not use a lookup table solution. Please advise.
The solution is timing out (it is just taking too long). I would recommend to change your code to use a single call to dijkstra_lanes instead of one separate call for each StartLane-to-EndLane combination. You may do so, for example, by adding two nodes to your graph, one "start" node that is connected (with distance 0) to every non-blocked lane in the first row, and one "end" node that is connected (with distance 0) to every non-blocked lane in the last row. Then you will only need to call dijkstra_lane once to compute the optimal path distance of this extended graph, instead of calling your function N1*N2 times (for each of the N1/N2 first/last -row non-blocked positions)
Thank you for the recommendation.
While evaluating the solution, the server encountered an error caused by long running MATLAB code. Edit the code if needed and then submit.
Add two numbers
Create an n-by-n null matrix and fill with ones certain positions
02 - Vector Variables 3
02 - Vector Variables 4
singularity 2.0 (really hard)
Smallest distance between a point and a rectangle
feeling VERY lucky?
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office