[Python] DP solution
\nclass Solution:\n    def dieSimulator(self, n: int, rollMax: List[int]) -> int:\n        dp = [[1]+[0]*(limit-1) for limit in rollMax]\n        \n        for 
```\nclass Solution:\n    def dieSimulator(self, n: int, rollMax: List[int]) -> int:\n        dp = [[1]+[0]*(limit-1) for limit in rollMax]\n        \n        for i in range(1, n):\n            new_dp = dp.copy()\n            dp_sum = [0, 0, 0, 0, 0, 0]\n            \n            for j in range(len(new_dp)):\n                dp_sum[j] = sum(new_dp[j])\n                new_dp[j].pop()\n                \n            for j in range(len(new_dp)):\n                new_dp[j].insert(0, sum(dp_sum)-dp_sum[j])\n                \n            dp = new_dp\n            \n        res = 0\n        for i in range(len(dp)):\n            res += sum(dp[i])\n        \n        return res%(10**9+7)\n```
[]