A simple python solution[Accepted]
```\nclass Solution:\n    def dieSimulator(self, n: int, rollMax: List[int]) -> int:\n        mod=10*9+7\n        dp=[[1]6 for i in range(n)]\n        for i in 
```\nclass Solution:\n    def dieSimulator(self, n: int, rollMax: List[int]) -> int:\n        mod=10**9+7\n        dp=[[1]*6 for i in range(n)]\n        for i in range(1,n):\n            for j in range(6):\n                dp[i][j]=sum([dp[i-1][k] for k in range(6)])\n                if i==rollMax[j]:\n                    dp[i][j]-=1\n                if i>rollMax[j]:\n                    dp[i][j]-=sum([dp[i-rollMax[j]-1][k] for k in range(6) if k!=j])\n        return sum(dp[-1])%mod\n````
[]