Implement Shortest Path Leetcode Contest