C++ DP Solution
\nclass Solution {\npublic:\n    \n   int dieSimulator(int n, vector<int>& rollMax) {\n       int t[n][6][16]; \n       memset(t,0,sizeof(t));\n        \n      
```\nclass Solution {\npublic:\n    \n   int dieSimulator(int n, vector<int>& rollMax) {\n       int t[n][6][16]; \n       memset(t,0,sizeof(t));\n        \n       for(int i=0;i<6;i++)\n           t[0][i][1]=1;\n        \n        for(int i=1;i<n;i++){\n            for(int j=0;j<6;j++){\n                for(int k=0;k<6;k++){\n                    if(k==j)\n                        continue;\n                    for(int m=1;m<=rollMax[k];m++){\n                        t[i][j][1]=(t[i][j][1]+t[i-1][k][m])%1000000007;\n                    }\n                   \n                    \n                }\n                 for(int m=2;m<=rollMax[j];m++){\n                        t[i][j][m]=(t[i-1][j][m-1])%1000000007;\n                    }\n            }\n        }\n        \n        int ans=0;\n        \n        for(int i=0;i<6;i++){\n            for(int j=1;j<=rollMax[i];j++){\n                ans=(ans+t[n-1][i][j])%1000000007;\n            }\n        }\n        return ans;\n    }\n};\n```
[]