simple python code using hashmap
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    def new21Game(self, n: int, k: int, maxPts: int) -> float:\n        if k==0:\n            return 1.0\n\n        windowsum=0\n        for i in range(k,k + maxPts):\n            windowsum+= 1 if i<=n else 0\n\n        dp={}\n        for i in range(k-1,-1,-1):\n            dp[i]=windowsum/maxPts\n            remove=0\n            if i+maxPts<=n:\n                remove=dp.get(i+maxPts,1)\n            windowsum+= dp[i]-remove\n        return dp[0] \n```
['Python3']