
Asked in Amazon
Unique Paths Problem Statement
Given the dimensions of an M x N matrix, determine the total number of unique paths from the top-left corner to the bottom-right corner of the matrix.
Allowed moves are only to the right or down at each step.
Input:
The first line contains an integer 'T', the number of test cases.
For each test case, a single line contains two space-separated integers 'M' and 'N', representing the number of rows and columns of the matrix, respectively.
Output:
For each test case, output a single integer representing the total number of unique paths from the top-left to the bottom-right cell of the matrix.
Print the output for each test case on a new line.
Example:
Input:
T = 2
M = 2, N = 2
M = 3, N = 3
Output:
2
6
Constraints:
1 ≤ T ≤ 100
1 ≤ M ≤ 15
1 ≤ N ≤ 15
- The time limit is 1 second
Note:
There is no need for you to print anything; simply implement the function to compute the results.

AnswerBot
4mo
The problem involves finding the total number of unique paths from the top-left corner to the bottom-right corner of an M x N matrix by moving only right or down.
Use dynamic programming to solve this ...read more
Help your peers!
Add answer anonymously...
Top Software Developer Interview Questions Asked at Amazon
Q. What is OOPS?
Q. What is Java programming?
Q. Could you describe the process for designing a data structure that allows for al...read more
Interview Questions Asked to Software Developer at Other Companies
Top Skill-Based Questions for Amazon Software Developer
Algorithms Interview Questions and Answers
250 Questions
Data Structures Interview Questions and Answers
250 Questions
Web Development Interview Questions and Answers
250 Questions
Java Interview Questions and Answers
250 Questions
SQL Interview Questions and Answers
250 Questions
Software Development Interview Questions and Answers
250 Questions
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

