@@ -0,0 +1,538 @@
+%0D%0Apublic class _375GuessNumberHigherOrLowerII %7B%0D%0A%09public int getMoneyAmount(int n) %7B%0D%0A        int%5B%5D%5B%5D table = new int%5Bn+1%5D%5Bn+1%5D;%0D%0A        return DP(table, 1, n);%0D%0A    %7D%0D%0A    %0D%0A    private int DP(int%5B%5D%5B%5D t, int s, int e)%7B%0D%0A        if(s %3E= e) return 0;%0D%0A        if(t%5Bs%5D%5Be%5D != 0) return t%5Bs%5D%5Be%5D;%0D%0A        int res = Integer.MAX_VALUE;%0D%0A        for(int x=s; x%3C=e; x++)%7B%0D%0A            int tmp = x + Math.max(DP(t, s, x-1), DP(t, x+1, e));%0D%0A            res = Math.min(res, tmp);%0D%0A        %7D%0D%0A        t%5Bs%5D%5Be%5D = res;%0D%0A        return res;%0D%0A    %7D%0D%0A%7D%0D%0A

Add 375 solution