Sherimoonzombie

Dungeon Game | Dynamic programming | Leetcode #174

Đánh giá post



Dungeon Game | Dynamic programming | Leetcode #174

This video explains a very important programming interview problem which is the dungeon game from leetcode #174.In this game, we are given a matrix of size N * M. Princess is present in the last cell (N, M) and the knight who will save her will start at (0,0).Each cell of the matrix is room of dungeon.Each of the room can be occupied by a demon or a magic orb.Knight looses an equal amount of health to fight demon and gains equal amount of health from a magical orb.As soon as the health of the knight reaches 0, he dies.We need to find the minimum health with which the knight should start such that there is atleast one possible path from the cell (0,0) to cell (N, N), so that the knight saves the princess.This is a variant of Minimum cost path problem.This can be solved using binary search and also using recursion.The best method to solve this is by using dynamic programming.I have explained the intuition for dynamic programming solution and have also explained the algorithm using proper examples.I have also shown the code walk through of the bottom-up dynamic programming at the end of the video.CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful…CYA 🙂

=================================================================
INSTAGRAM:
LinkedIn:
=================================================================

CODE LINK:
USEFUL PROBLEM:-
Minimum cost path:

Tag: dungeon game, programming interview questions, coding interview questions, programming tutorials, computer science, geeksforgeeks, programming, leetcode, leetcode solution, tech dose, Dungeon Game, Leetcode #174, Minimum cost path, variant of minimum cost path, dp, dynamic programming, bottom up, bottom up dp, bottom up dynamic programming, minimum sum path, dynamic programming interview problem, day 21, june challenge, dp interview question

Xem thêm bài viết về PC: https://sherimoonzombie.net/pc

Nguồn: https://sherimoonzombie.net

Exit mobile version