Python Does Path Exists Leetcode 150