A robot starts at the top-left of a grid and can only move right or down to reach the bottom-right. Cells with 1 are obstacles. Return the number of distinct paths, using a single row of DP (O(columns) space).
Also implement min_path_sum(grid): the minimum sum of numbers along a right/down path through a grid of non-negative numbers.