Easy C++ Solution
\nusing ll = long long;\n\nll dp[205][205];\nconst ll mod = 1e9 + 7;\nint n;\n\nll solve(int index, string &s, vector<int> &v, int piche)\n{\n    if (index >= s
```\nusing ll = long long;\n\nll dp[205][205];\nconst ll mod = 1e9 + 7;\nint n;\n\nll solve(int index, string &s, vector<int> &v, int piche)\n{\n    if (index >= s.size())\n        return 1;\n\n    if (dp[index][piche] != -1)\n        return dp[index][piche];\n\n    dp[index][piche] = 0;\n\n    if (s[index] == \'D\')\n    {\n        for (int i = 0; i < piche; ++i)\n        {\n            if (v[i] == 0)\n            {\n                v[i] = 1;\n                dp[index][piche] += solve(index + 1, s, v, i);\n                dp[index][piche] %= mod;\n                v[i] = 0;\n            }\n        }\n    }\n    else\n    {\n        for (int i = piche + 1; i < n + 1; ++i)\n        {\n            if (v[i] == 0)\n            {\n                v[i] = 1;\n                dp[index][piche] += solve(index + 1, s, v, i);\n                dp[index][piche] %= mod;\n                v[i] = 0;\n            }\n        }\n    }\n\n    return dp[index][piche] %= mod;\n\n}\n\nclass Solution\n{\n    public:\n        int numPermsDISequence(string s)\n        {\n            memset(dp, -1, sizeof(dp));\n            n=s.size();\n            \n            if(n==1)\n                return 1;\n            \n            vector<int>v(n+1,0);\n            \n            ll ans=0;\n            \n            for(int i=0;i<=n;++i)\n            {\n                v[i]=1;\n                ans+=solve(0,s,v,i);\n                ans%=mod;\n                v[i]=0;\n            }\n            return ans;\n            \n        }\n};\n```
['Dynamic Programming', 'Memoization', 'C', 'C++']