Check if There is a Valid Path in a Grid
Each street type opens onto specific sides; search from the top-left cell through cells whose open sides connect back.
Each street type opens onto specific sides; search from the top-left cell through cells whose open sides connect back.