This question needs clarification: the output is the minimum cost, not the "path"


  • 0
    Z

    The output is the minimum cost, not the "path"

    The path is simple as well, just trace back from the end to the origin, by finding the minimum previous step

    PS: interestingly, if diagonal (to down-right) move is allow, the algorithm for the path is the standard Dynamic Time Warping (the input is the table of item-wise distance)


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.