Path With Minimum Effort Leetcode Solution