Given a grid of size m x n
, count the number of unique paths from top-left to bottom-right corner.
Rules:
Constraints:
Examples:
// Example 1: console.log(uniquePaths(3, 6)); // Output: 21 // Explanation: 21 different ways to reach bottom-right // Example 2: console.log(uniquePaths(3, 3)); // Output: 6 // Explanation: 6 different ways in 3x3 grid