The previous lesson discussed the prison break problem with a rectangular wall-shaped room. This lesson discusses a variant of the prison break problem with just one change; the wall could be any irregular polygon.

The prison break problem 2

The following is the convention we'll follow for the 2-D map:

  • 0 represents moveable space.

  • 1 represents the wall.

  • 2 represents a prison starting point for the prisoner.

  • 3 will represent the stride of the prisoner (that will be used while finding the path).


Below is one example of the 2-D map.

If you click on a number in the widget, all the numbers that are the same will also be highlighted. This helps us view the shape more easily.

Get hands-on with 1200+ tech skills courses.