Miscellaneous

Melting ice

Several ice formations can be seen in the nearby mountains. Your map is a rectangular grid in which squares containing ice are shaded. As it happens every spring, the ice starts to melt. During any day, the ice in a square will melt if and only if at least one of the four surrounding squares does not contain ice.

You have found a second map which indicates the location of an ancient treasure is buried under the ice. How can you compute the number of days you need to wait before starting to dig for the treasure?

Ice

You are given the map of a rectangular maze (walls are shaded black). Design an algorithm that finds the shortest route from the lower left to the upper right corner?

Maze