Leetcode 64 Minimum Path Algorithm