Dungeon Escape Problem — The Smart Way to Solve It
Автор: English Through Science
Загружено: 2026-02-16
Просмотров: 20
Описание:
🏰 Dungeon Problem — find the shortest path in a 2D grid
🗺️ Grid of size R × C with:
• S — start
• E — exit
• # — wall
• . — empty cell
⏱️ Move in 4 directions (no diagonals), 1 minute per move
🎯 Goal: reach E in the minimum time or return -1 if impossible
• Solution:
⚡ Use Breadth-First Search (BFS)
📥 Start from S, explore layer by layer
✅ First time we reach E → shortest path found
🚫 Skip walls and visited cells
Simple idea: a grid is an implicit graph, and BFS gives the shortest path in an unweighted graph.
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: