62. Unique Paths

A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).

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 (marked 'Finish' in the diagram below).

How many possible unique paths are there?

62. Unique Paths_第1张图片

常规做法dp, 发现一个大神用组合的方式, Cnk ,  从start 到end 有m+n-2 步要走, 向下走m-1步。
m+n-2 中向下走m-1 的组合方式 有C(m+n-2) (m-1) 种


62. Unique Paths_第2张图片

你可能感兴趣的:(62. Unique Paths)