C++ solution to Leetcode 63. Unique Paths II