Ad
  • Custom User Avatar

    Suggestion not specific enough, closing

  • Custom User Avatar

    Sorry, but you're asking something that's been asked and answered several times before, and I referred you to the first one of those not marked as spoiler, I won't copy and paste the same answer all over the place, you should have read the posts already here before asking it again.

  • Custom User Avatar

    Go down, read Daotar's post.

  • Custom User Avatar

    X denotes the column of the endpoint, or the horizontal point if you will.

    Y denotes the row of the endpoint, or the vertical point if you will.

    With coordinates (0, 0) it should be obvious why the minimum path is 1, since you're starting and ending at the same position with the value 1.

    Here is the minimum path of the grid given before, when the endpoint is in (0, 1):

    [1,_,_],
    [4,_,_],
    [_,_,_]
    
  • Custom User Avatar

    You always start at the upper left corner. Then, each nested array represents a row in the 2D-grid.

    In the test-case you're referencing you're given the following grid:

    [1,2,3],
    [4,8,2],
    [1,5,3]
    

    The end coordinate is x = 0, y = 1, which is where the 4 is in the grid. Therefore the minimum path will be 1 + 4 = 5.