注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
本帖最后由 匿名 于 2021-7-12 10:35 编辑
An m by n board is given and a mouse wants to go from cell (0,0) to cell (m-1,n-1).
There are some void cells on which the mouse cannot walk. You need to implement
an algorithm that finds the shortest path that the mouse can take to go from cell
(0,0) to cell (m-1,n-1) without walking on void cells. You are given two integers m
and n which determine the dimension of your table two integer arrays containing
the x and y indices of void cells.
Black cells are void and red cells show the path from (0,0) to (m-1,n-1).
图片在附件里
Inputs are: m=5, n=5, xarrray={1,4}, yarray={1,0}
|