Bloomberg | Phone Interview | New Grad
2634

A labyrinth of zeros and ones is given. Zero - "cannot pass", One - "can pass."
List all paths from top left to bottom-right corner. You can move only down or to the right.
Input: 2-dimensional array that contains the labyrinth.
Example:
Input = [[1,0,1], [1,1,1], [0,1,1]]
Input in 2D:
1 0 1
1 1 1
0 1 1

Output:
(0,0) (1,0) (1,1) (2,1) (2,2)
(0,0) (1,0) (1,1) (1,2) (2,2)

if impossible to reach bottom-right corner, print "No paths."

Please feel free to post your solutions!

Comments (13)