# Problem
# note: if someone can write this better that would be great
Consider an MxN matrix where 1's represent occupied spaces and 0's represent empty spaces such that a maze is formed.
consider that you must land from point A to point B by the shortest path, obviously you cannot go through occupied spaces, i.e occuped by 1's.
Consider a special case, which we'll call a "dimensional step" that consists of when you cross the board from side to side through empty spaces by an overflow (in the style of pac-man), which can be a shortcut to shorten the journey.
The result should be a three-element tuple(or vector) array, containing the next position (in order) to go the way.
(`i`, `j`, `bool`)
where `i,j`represents position in matrix of next step, and `bool` represents if it is a dimensional step , being true when it is the case and false when not.
## Example
```ts
maze =
[
[1, 1, 1, 1, 1],
[B, 0, 0, 0, 1],
[0, 0, 0, 0, A],
[1, 0, 0, 0, 1],
[1, 1, 1, 1, 1],
]
```
## Result (in two steps)
```ts
[
(2, 0, true), // true is dimentional step
(0, 1, false)
]
```
## Steps explain
### step 0 (source)
```ts
maze =
[
[1, 1, 1, 1, 1],
[B, 0, 0, 0, 1],
[0, 0, 0, 0, A],
[1, 0, 0, 0, 1],
[1, 1, 1, 1, 1],
]
```
### step 1
```ts
maze =
[
[1, 1, 1, 1, 1],
[B, 0, 0, 0, 1],
[A, 0, 0, 0, 0],
[1, 0, 0, 0, 1],
[1, 1, 1, 1, 1],
]
```
### step 2 (target)
```ts
maze =
[
[1, 1, 1, 1, 1],
[A, 0, 0, 0, 1],
[0, 0, 0, 0, 0],
[1, 0, 0, 0, 1],
[1, 1, 1, 1, 1],
]
```