c++ back to front, sliding window
\ndouble new21Game(int n, int k, int maxPts) {\n        int maxScore = k - 1 + maxPts;\n        if (maxScore <= n) {\n            return 1.0;\n        }\n      
```\ndouble new21Game(int n, int k, int maxPts) {\n        int maxScore = k - 1 + maxPts;\n        if (maxScore <= n) {\n            return 1.0;\n        }\n        vector<double> dp(k + maxPts, 0);\n        for(int i = k; i <= n; i++) {\n            dp[i] = 1.0;\n        }\n        double sum = n - k + 1;\n        for(int i = k-1; i >= 0; i--) {\n            dp[i] = sum / maxPts;\n            sum = sum + dp[i] - dp[i + maxPts];\n        }\n        return dp[0];\n    }\n```
[]