My code does not pass one input. Could the test case be wrong


  • 1
    Z

    On input
    [[5,4,2,9,6,0,3,5,1,4,9,8,4,9,7,5,1],
    [3,4,9,2,9,9,0,9,7,9,4,7,8,4,4,5,8],
    [6,1,8,9,8,0,3,7,0,9,8,7,4,9,2,0,1],
    [4,0,0,5,1,7,4,7,6,4,1,0,1,0,6,2,8],
    [7,2,0,2,9,3,4,7,0,8,9,5,9,0,1,1,0],
    [8,2,9,4,9,7,9,3,7,0,3,6,5,3,5,9,6],
    [8,9,9,2,6,1,2,5,8,3,7,0,4,9,8,8,8],
    [5,8,5,4,1,5,6,6,3,3,1,8,3,9,6,4,8],
    [0,2,2,3,0,2,6,7,2,3,7,3,1,5,8,1,3],
    [4,4,0,2,0,3,8,4,1,3,3,0,7,4,2,9,8],
    [5,9,0,4,7,5,7,6,0,8,3,0,0,6,6,6,8],
    [0,7,1,8,3,5,1,8,7,0,2,9,2,2,7,1,5],
    [1,0,0,0,6,2,0,0,2,2,8,0,9,7,0,8,0],
    [1,1,7,2,9,6,5,4,8,7,8,5,0,3,8,1,5],
    [8,9,7,8,1,1,3,0,1,2,9,4,0,1,5,3,1],
    [9,2,7,4,8,7,3,9,2,4,2,2,7,8,2,6,7],
    [3,8,1,6,0,4,8,9,8,0,2,5,3,5,5,7,5],
    [1,8,2,5,7,7,1,9,9,8,9,2,4,9,5,4,0],
    [3,4,4,1,5,3,3,8,8,6,3,5,3,8,7,1,3]]

    ckeckers solution is 82, but mine is is 79 with the following path:

    [05] 04 02 09 06 00 03 05 01 04 09 08 04 09 07 05 01

    [03][04] 09 02 09 09 00 09 07 09 04 07 08 04 04 05 08

    06 [01] 08 09 08 00 03 07 00 09 08 07 04 09 02 00 01

    04 [00][00] 05 01 07 04 07 06 04 01 00 01 00 06 02 08

    07 02 [00][02] 09 03 04 07 00 08 09 05 09 00 01 01 00

    08 02 09 [04] 09 07 09 03 07 00 03 06 05 03 05 09 06

    08 09 09 [02] 06 01 02 05 08 03 07 00 04 09 08 08 08

    05 08 05 [04][01] 05 06 06 03 03 01 08 03 09 06 04 08

    00 02 02 03 [00] 02 06 07 02 03 07 03 01 05 08 01 03

    04 04 [00][02][00] 03 08 04 01 03 03 00 07 04 02 09 08

    05 09 [00] 04 07 05 07 06 00 08 03 00 00 06 06 06 08

    00 07 [01] 08 03 05 01 08 07 00 02 09 02 02 07 01 05

    01 00 [00][00][06][02][00][00][02][02][08][00] 09 07 00 08 00

    01 01 07 02 09 06 05 04 08 07 08 [05][00] 03 08 01 05

    08 09 07 08 01 01 03 00 01 02 09 04 [00][01][05][03][01]

    09 02 07 04 08 07 03 09 02 04 02 02 07 08 02 06 [07]

    03 08 01 06 00 04 08 09 08 00 02 05 03 05 05 07 [05]

    01 08 02 05 07 07 01 09 09 08 09 02 04 09 05 04 [00]

    03 04 04 01 05 03 03 08 08 06 03 05 03 08 07 01 [03]

    Does anyone have a suggestion what I am doing wrong?


  • 0
    A

    I am finding a similar issue where I am getting shorter paths that are valid when manual walking them then the checker is providing


  • 1
    P

    The issue is "You can only move either down or right at any point in time" so this is not a true "shortest paths" question.


Log in to reply
 

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