문제
Plot a path through the asteroid field. Given a starting location, final destination, and a description of the asteroid fields plot a shortest path that takes you from the starting location to the final destination without running into any asteroids. The asteroid field is described using a mxm grid of characters with
- s: for starting location
- d: for final location
- -: for open space
- *: asteroid
Here is an example of a 4x4 grid.
s*-* -*-* ---- *-*d
Your ship can move up, down, left, and right (not diagonally). Each position in a mxm grid will be assigned an integer between 0 and m2-1 as follows.