Showing:
Handle Score
@Ibrahim Nash 6560
@mb1973 5777
@Quandray 5275
@akhayrutdinov 5111
@saiujwal13083 5074
@kirtidee18 4408
@sanjay05 3762
@mantu_singh 3666
@gfgaccount 3605
@marius_valentin_dragoi 3525
Count all possible paths from top left to bottom right
Easy Accuracy: 41.36% Submissions: 6448 Points: 2

The task is to count all the possible paths from top left to bottom right of a n matrix with the constraints that from each cell you can either move only to right or down.

Example 1:

Input: m = 2, n = 2
Output: 2
Explanation: Two possible ways are
RD and DR.


Example 2:

Input: m = 3, R = 3
Output: 6
Explanation: Six possible ways are
RRDD, DDRR, RDDR, DRRD, RDRD, DRDR.


You dont need to read input or print anything. Complete the function numberOfPaths() which takes m and n as input parameter and returns count all the possible paths.The answer may be very large, compute the answer modulo 109 + 7.

Expected Time Complexity: O(m*n)
Expected Auxiliary Space: O(m*n)

Constraints:
1 <= m <=100
1 <= n <=100