Python DP
\nclass Solution:\n    def new21Game(self, N: int, K: int, W: int) -> float:\n        dp = [0 for i in range(N+2)]\n        dp[0] = 1\n        dp[1] = -1\n     
```\nclass Solution:\n    def new21Game(self, N: int, K: int, W: int) -> float:\n        dp = [0 for i in range(N+2)]\n        dp[0] = 1\n        dp[1] = -1\n        ans = 1\n        curprob = 0\n        for i in range(0,K):\n            curprob = curprob + dp[i]\n            if i+W > N:\n                ans -= curprob*(i+W-N)/W\n                dp[i+1] += curprob/W\n            else:\n                dp[i+1] += curprob/W\n                dp[i+W+1] -= curprob/W\n            \n        return ans\n```
[]