🔥✅Easy & Clean DP Code || 💯Memoization⚡
Connect with me on LinkedIN : https://www.linkedin.com/in/aditya-jhunjhunwala-51b586195/\n\n# Code\n## Please Upvote if it helps\uD83E\uDD17\n\nclass Solution {
## Connect with me on LinkedIN : https://www.linkedin.com/in/aditya-jhunjhunwala-51b586195/\n\n# Code\n## Please Upvote if it helps\uD83E\uDD17\n```\nclass Solution {\npublic:\n    int mod = 1e9 + 7;\n    int x = \'l\' - \'a\', y = \'e\' - \'a\', z = \'t\' - \'a\';\n    \n    int dp[100001][2][2][3];\n    int helper(int ind, int n, bool l, bool t, int count){\n        if(ind == n){\n            if(l && t && count == 2)\n                return 1;\n            return 0;\n        }\n        if(dp[ind][l][t][count] != -1)\n            return dp[ind][l][t][count];\n        int ans = 0;\n        for(int i = 0 ; i < 26 ; i++)\n            ans = (ans + helper(ind + 1, n, (l || i == x) ? true : false, (t || z == i) ? true : false, (y == i && count < 2) ? count + 1 : count)) % mod;\n        return dp[ind][l][t][count] = ans;\n    }\n    \n    int stringCount(int n) {\n        memset(dp, -1, sizeof(dp));\n        return helper(0, n, false, false, 0);\n    }\n};\n```
['Dynamic Programming', 'Memoization', 'C++']