Hey, this is awesome solution, thanks for posting. The MOST crucial part of your solution is to not remove visited coordinates in DFS and reuse the visited set in BFS. Wanted to explain your viewers - its importance in your approach. This is because the visited set kinda guides the BFS algorithm - what cells can be visited and what are not. Like, it'll help you to not add a location with obstacle and etc. If a location is in the visited set after DFS - it is a good location. And that set is why this approach works. cheers.
@TheSmashtenАй бұрын
Thanks for doing this problem. Can you please do 'Remove Sub-Folders from the Filesystem (LC 1233)'?
@ziqinwu233711 күн бұрын
thank you!
@suri4MusiqАй бұрын
Is there a reason to pick this problem? - This requires premium leetcode subscription.
@insofcuryАй бұрын
Awesome solution. Would be great if you can help understand how are we assuming 0,0 as source