New 21 Game 100% Beats
100% Beats\n# Code\n\npublic class Solution {\n    public double New21Game(int n, int k, int maxPts) {\n        if(k==0||n>=k+maxPts){\n            return 1.0;\
**100% Beats**\n# Code\n```\npublic class Solution {\n    public double New21Game(int n, int k, int maxPts) {\n        if(k==0||n>=k+maxPts){\n            return 1.0;\n        }\n        double[] arr=new double[n+1];\n        double Sum=1.0, result=0.0;\n        arr[0]=1;\n        for(int i =1;i<arr.Length;i++){\n            arr[i]=Sum/maxPts;\n            if(i<k){\n                Sum+=arr[i];\n            }\n            else{\n               result+=arr[i]; \n            }\n            if(i-maxPts>=0){\n                Sum=Sum-arr[i-maxPts];\n            }\n        }\n        return result;\n    }\n}\n```
['Math', 'Probability and Statistics', 'C#']