Java solution using dp
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public double new21Game(int n, int k, int maxPts) {\n        if(k==0) return 1.00;\n        if(k==1 && maxPts<=n) return 1.00;\n        double dp[] = new double[n+1];\n        dp[0] = 1.00;\n        double prev=0.00;\n        for(int i=1; i<=n; i++){\n            if((i-maxPts-1)>=0){\n                prev-=dp[i-1-maxPts];\n            }\n            if((i-1)<k){\n                prev+=dp[i-1];\n            }\n            dp[i]=prev/maxPts;            \n        }\n\n        double res = 0.00;\n        for(int i=k; i<=n; i++){\n            res+=dp[i];\n        }\n        return res;        \n    }\n}\n\n// 12\n// k =\n// 1\n// maxPts =\n// 10\n```
['Java']