DP || C++
Code\n\nclass Solution \n{\npublic:\n    long long mod=1e9+7;\n    long long dp[100011][2][3][2];\n    long long f(int i, int l, int e, int t, int n)\n    {\n  
# Code\n```\nclass Solution \n{\npublic:\n    long long mod=1e9+7;\n    long long dp[100011][2][3][2];\n    long long f(int i, int l, int e, int t, int n)\n    {\n        if(i==n)\n        {\n            if(l>=1 && e>=2 && t>=1) return 1;\n            return 0;\n        }\n        if(dp[i][l][e][t]!=-1) return dp[i][l][e][t];\n        long long ans=0;\n        for(char ch=\'a\'; ch<=\'z\'; ch++)\n        {\n            if(ch==\'l\' && l<1) ans=(ans+f(i+1,l+1,e,t,n))%mod;\n            else if(ch==\'e\' && e<2) ans=(ans+f(i+1,l,e+1,t,n))%mod;\n            else if(ch==\'t\' && t<1) ans=(ans+f(i+1,l,e,t+1,n))%mod;\n            else ans=(ans+f(i+1,l,e,t,n))%mod;\n        }\n        return dp[i][l][e][t]=ans;\n    }\n    int stringCount(int n) \n    {\n        memset(dp,-1,sizeof(dp));\n        return f(0,0,0,0,n);\n    }\n};\n```
['Dynamic Programming', 'C++']