Check if There is a Valid Path in a Grid

Solution Code
Video GuideLeetcode Daily

Time Complexity

O(t α(t)

Space Complexity

O(t)