Python Does Path Exists Leetcode Javascript Practice