Solution: Dungeon Game
Explore a dynamic programming approach to find the minimum initial health required for a knight to safely navigate a 2D dungeon grid and rescue a princess. This lesson guides you through computing health needs backwards from the destination, ensuring the knight's survival with at least one health point at each step.
We'll cover the following...
We'll cover the following...
Statement
A group of demons has captured a princess and locked her in the bottom-right corner of a dungeon. The dungeon is represented as a 2D grid of size
The knight, starting in the top-left corner of the grid, must travel through the dungeon to rescue the princess.
He can move only to the right or downward at each step.
If a cell ...