Mouse Journey is a problem that is related to simple math. Read the problem first.
The logic is simple: the total number of possibilities is the number of possibilities for the one above and the one to the left. The start is 1, and the cat areas are 0.
Now, just add the bumbers until you get to the end. The number at the end is the answer!
Sample solution:
def find_possibilities(i, j, cages):
if i == 0:
cages[i][j] = cages[i][j-1]
elif j == 0:
cages[i][j] = cages[i-1][j]
else:
cages[i][j] = cages[i-1][j] + cages[i][j-1]
return cages
r, c = map(int, input().split())
cages = []
for i in range(r):
add = []
for j in range(c):
add.append(-1)
cages.append(add)
for i in range(int(input())):
catx, caty = map(int, input().split())
catx -= 1
caty -= 1
cages[catx][caty] = 0
cages[0][0] = 1
for i in range(r):
for j in range(c):
if cages[i][j] == -1:
cages = find_possibilities(i, j, cages)
print(cages[-1][-1])