We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
We can solve it with breadth-first search (BFS). We can adapt it for 2d arrays. Generally, when adapting BFS for 2d arrays, we consider all neighbours cells as vertices. As the exercise allow us to move many cells in the same row or column with one movement, we need to consider that as well.
Castle on the Grid
You are viewing a single comment's thread. Return to all comments →
We can solve it with breadth-first search (BFS). We can adapt it for 2d arrays. Generally, when adapting BFS for 2d arrays, we consider all neighbours cells as vertices. As the exercise allow us to move many cells in the same row or column with one movement, we need to consider that as well.
Here is the full implementation on python
`