Easy Approach || 100% Efficient and Beginners friendly || Dynamic Programming
Intuition\nThe function stringCount initializes the memoization array, sets the initial conditions, and then calls the helper function to perform the recursive 
# Intuition\nThe function stringCount initializes the memoization array, sets the initial conditions, and then calls the helper function to perform the recursive counting. The recursive function considers the possibilities for each character position, taking into account the constraints on the counts of \'l\', \'e\', and \'t\'.\n\nThe code essentially explores all possible combinations of characters at each position, satisfying the given constraints, and counts the valid strings.\n\nCode is written in easy and explainable manner for better understanding.\n \n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(4^n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: The space complexity is determined by size of the dp array is (101010) * 2 * 3 * 2 * sizeof(long long), which simplifies to 101010 * 12 * sizeof(long long).\n\nSo, the space complexity is O(1) since the size of the dp array is constant\n\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n  long long dp[101010][2][3][2];\n  long long mod=1e9+7;\n  \n  long long helper(int n,int l,int e,int t){\n    if(n==0)\n    {\n      return l==0 and e==0 and t==0; \n    }\n    \n    \n    //stores value \n    long long& res=dp[n][l][e][t];\n    \n    if(res!=-1){\n      return res;\n    }\n    \n    res=helper(n-1,l,e,t)*(26-(e>0)-(l>0)-(t>0))%mod;\n    \n    if(e>0){\n      res=(res+helper(n-1,l,e-1,t))%mod;\n    }\n    if(t>0){\n      res=(res+helper(n-1,l,e,t-1))%mod;\n    }\n    if(l>0){\n      res=(res+helper(n-1,l-1,e,t))%mod;\n    }\n    \n    return res;\n  }\n  \npublic:\n    int stringCount(int n) {\n      memset(dp,-1,sizeof dp);\n\n      return helper(n,1,2,1);\n        \n    }\n};\n```\n\n![image.png](https://assets.leetcode.com/users/images/e64d4739-05b0-403d-a515-24dbecd57e8b_1699869087.4641535.png)\n
['Math', 'Dynamic Programming', 'Recursion', 'C++']