@@ -0,0 +1,942 @@
+public class Solution %7B%0A    public int calculateMinimumHP(int%5B%5D%5B%5D d) %7B%0A        int n = d.length;%0A        int m = d%5B0%5D.length;%0A        int%5B%5D%5B%5D mark = new int%5Bn%5D%5Bm%5D;%0A        mark%5Bn-1%5D%5Bm-1%5D = Math.max(1, 1 - d%5Bn-1%5D%5Bm-1%5D);%0A        for(int i=n-1; i%3E=0; i--) %7B%0A            for(int j=m-1; j%3E=0; j--) %7B%0A                int down = 0;%0A                int right = 0;%0A                if(i %3C n-1) %7B%0A                    down = Math.max(1, mark%5Bi+1%5D%5Bj%5D - d%5Bi%5D%5Bj%5D);%0A                %7D%0A                if(j %3C m-1) %7B%0A                    right = Math.max(1, mark%5Bi%5D%5Bj+1%5D - d%5Bi%5D%5Bj%5D);%0A                %7D%0A                if(down == 0 && right == 0) mark%5Bi%5D%5Bj%5D = Math.max(1, 1 - d%5Bi%5D%5Bj%5D);%0A                else %7B%0A                    if(down == 0) down = Integer.MAX_VALUE;%0A                    if(right == 0) right = Integer.MAX_VALUE;%0A                    mark%5Bi%5D%5Bj%5D = Math.min(down, right);%0A                %7D%0A            %7D%0A        %7D%0A        return mark%5B0%5D%5B0%5D;%0A    %7D%0A%7D%0A

Create Dungeon_Game.java