rewrite leetcode unique paths i ii