Expected Output for this test case


  • 0
    K

    Hello all,

    For the following test case
    [[1,6,7,4,2,8,3,12],[1,6,27,14,2,15,12,1],[3,3,5,6,7,5,3,1]]

    The expected output shows [0, 2] as one of the coordinates which can reach both the oceans. How is this possible? Can anyone provide me an explanation


  • 0
    D

    Obviously [0,2] can reach the Pacific as it's already touching the top edge. To get to the bottom edge, it can take the path [0,1], [1,1], [1,2].


Log in to reply
 

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