a problem for a princess

princess has to run out of a maze and we have to tell the total number of unique ways in which she can come out of the maze.
she has to go from 0,0 to n,n //n for no. of rows and columns..
moving diagonally is not allowed..

input: it contains the no. of lines and in the next line it contains n lines containing binary values each separated by space.
0 denotes an open cell while 1 denotes a blocked cell..

output: total no. of unique ways..

EXAMPLE::
input:
7
0 0 1 0 0 1 0
1 0 1 1 0 0 0
0 0 0 0 1 0 1
1 0 1 0 0 0 0
1 0 1 1 0 1 0
1 0 0 0 0 1 0
1 1 1 1 0 0 0

output:
4


please ,help me to figure out the solution of the above question..
Last edited on
Let me guess: have you discussed graphs and DFS on your course?
Topic archived. No new replies allowed.