Unique Paths

Medium Solved

Description

A robot is located at the top-left corner of an m × n grid. The robot can only move either down or right at any point in time.

The robot is trying to reach the bottom-right corner of the grid. How many unique paths are there?

Input format:

  • Line 1: Integer m (rows)
  • Line 2: Integer n (columns)

Examples

Input:
3
7

Output:
28
Input:
3
2

Output:
3

Note:

Print a single integer representing the total number of unique paths.

No submissions yet.

Discuss dynamic programming, combinatorics approach, and space optimization.

Test Cases