Unique Paths 2 Leetcode Javascript Question