Apr 27 (edited) • General discussion
Leetcode Daily Question: 27 Apr 2026
Problem: 1391. Check if There is a Valid Path in a Grid
Level: Medium
Check whether there is a valid path from the top-left cell to the bottom-right cell. Each grid cell has a street type, and you can only move to a neighboring cell if both streets connect to each other.
Solution:
  • Use BFS starting from (0, 0).
  • For each street type, store the two directions it can move.
  • When moving to a neighbor, check whether the neighbor has a direction that connects back to the current cell.
  • If yes, push it into the queue and mark it as visited. At the end, return whether (n - 1, m - 1) was visited.
0
0 comments
Dsa Skool
1
Leetcode Daily Question: 27 Apr 2026
powered by
Coding Interview Academy
skool.com/coding-interview-academy-2634
Land your dream tech job, master DSA and problem solving, crack coding interviews, and learn the strategies top candidates use to get offers.
Build your own community
Bring people together around your passion and get paid.
Powered by