Count All Possible Distribution of Characters | | Recursive DP
Intuition\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 
# Intuition\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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(n*26)$$\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(n)$$ overall\n# Code\n```\nint dp[100001][2][2][3];\nclass Solution {\n    const int mod = 1e9+7;\n    int f(int i,int l,int t,int e)\n    {\n        l = max(0,l);\n        e = max(0,e);\n        t = max(0,t);\n        if(i==0)return l<=0 && t<=0 && e<=0;\n        long long ans = 0;\n        if(dp[i][l][t][e]!=-1)return dp[i][l][t][e];\n                ans = (ans + f(i-1,l-1,t,e))%mod; // select l\n                ans = (ans + f(i-1,l,t,e-1))%mod; // select e\n                ans = (ans + f(i-1,l,t-1,e))%mod; // select t\n        ans  = (ans + (23ll*f(i-1,l,t,e))%mod)%mod; //select left 23 characters\n        return dp[i][l][t][e] = ans%mod;\n    }\npublic:\n    int stringCount(int n) {\n        memset(dp,-1,sizeof dp);\n        return f(n,1,1,2);\n    }\n};\n```
['Recursion', 'C++']