Maneuvering in a Cave

Published by Mubashir Hassan in

Create a function that returns the count of all possible paths from top left to bottom right of an m * n matrix with the constraints that from each cell you can either move to the right or down.

Examples

calc(2, 2) ➞ 2

calc(3, 3) ➞ 6

calc(4, 4) ➞ 20

Note:

m may not be equal to n.

Watch a quick demo on how Edabit works.