Simple C++ Solution
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 {\npublic:\n    double new21Game(int N, int K, int maxPts) {\n       \n        if (K == 0) return 1.0;\n        if (N >= K-1 + maxPts) return 1.0;\n\n        \n        vector<double> dp(N + 1, 0.0);\n\n        double probability = 0.0; \n        double windowSum = 1.0; \n        dp[0] = 1.0;\n        for (int i = 1; i <= N; i++) {\n            dp[i] = windowSum / maxPts;\n\n            if(i < K) windowSum += dp[i];\n            else probability += dp[i];\n            \n            if(i >= maxPts) windowSum -= dp[i - maxPts];\n        }\n\n        return probability;\n    }\n};\n```
['C++']