Standard Bar Dynamic Programming · 2D DP O(m*n) · O(n)
A courier drone flies over a city laid out as an m x n grid of blocks, launching at the northwest depot and landing at the southeast customer. Air-traffic rules allow only eastward and southward movement — no backtracking. Logistics needs to know how many distinct legal flight plans exist so it can spread fleet traffic across them.
Input: Two integers m (rows) and n (columns) describing the grid.
Output: Return the number of distinct down/right-only paths from the top-left to the bottom-right cell.
1 <= m, n <= 100the answer fits in a 32-bit signed integerInput: {"m":3,"n":7}
Output: 28
Every path is a sequence of 2 downs and 6 rights; the cell DP accumulates to 28.
Input: {"m":3,"n":2}
Output: 3
Two downs interleaved with one right: DDR, DRD, RDD.