The big challenge in this problem was to prevent paths from being recalculated, since this problem space is even larger than 67, which takes an unreasonable amount of time to brute force.
This caching was done with cache[][] and the first check in the minpath(x,y) function. If the value has already been calculated, the function returns that value right away, saving time and unnecessary recursion. It also proved to be a convenient way to signal the bottom right corner, by prefilling cache[79][79] with that squares value.
Runtime: 0.004 seconds
PE081_c
Return to list of solutions
Comments (0)
You don't have permission to comment on this page.