Wrong count with the Swift call implementation or interpreter


  • 0
    S

    I'm getting the wrong size back from:

    matrix[0].count

    this causes all kinds of badness. Since matrix is passed in on the call, something in the calling routine is wrong.

    For example, on input:

    [["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]]

    matrix[0].count returns 6 instead of 5 which leads to:

    fatal error: Index out of range

    Not sure this is the wrong place to report this this, but at least it's in public.


Log in to reply
 

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