Skip to content

Bug Report for shortest-path-in-binary-matrix #6160

Description

@isoiphone

Bug Report for https://neetcode.io/problems/shortest-path-in-binary-matrix

Compilation problem with the Swift test harness for this problem.

class Solution {
    func shortestPathBinaryMatrix(_ grid: [[Int]]) -> Int {
        return -1
    }
}

Outputs an error

main.swift:62:52: error: '&' used with non-inout argument of type '[[Int]]'
63 |     let solution = Solution()
64 |     var grid = parseNestedArray(parseInput(lines[I]))
65 |     let output = solution.shortestPathBinaryMatrix(&grid)
   |                                                    `- error: '&' used with non-inout argument of type '[[Int]]'
66 |     print("===USE_THIS_LINE_TO_SEPARATE_USER_LOGS_AND_TEST_CASE_OUTPUT_394w8389wry89areisJAHSDBHJBdsjnkzbdcifbscidfbasekhfgiJHBG===")
67 |     print(output)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions