DP || recursion
We need to count the number of strings of length n which have atleast 1 l, 2 e and 1 tin them..\n\nAt any point in forming our string we can place other 23 char
We need to count the number of strings of length n which have atleast `1 l, 2 e and 1 t `in them..\n\nAt any point in forming our string we can place other 23 characters and it will not effect the count of `l,t,e`.\n\nseperately place `l,e,t` and decrease the count of l,e,t required in the recursive function.\n\n```\n class Solution {\n    private static final long MOD = 1_000_000_007L;\n    private long[][][][] dp;\n    public int stringCount(int n) {\n        dp = new long[n+1][2][3][2];\n        for(int i=0;i<dp.length;i++) for(int j=0;j<dp[0].length;j++) for(int k=0;k<dp[0][0].length;k++) for(int m=0;m<dp[0][0][0].length;m++) dp[i][j][k][m] = -1;\n        return (int)solve(n,1,2,1);\n    }\n    private long solve(int n,int l,int e,int t){\n        if(n == 0){\n            if(l == 0 && e == 0 && t == 0) return 1L; //Its a valid string\n            return 0L;\n        }\n        if(dp[n][l][e][t]!=-1) return dp[n][l][e][t];\n        long ans = solve(n-1,l,e,t)*23L%MOD;  //Place other 23 aplhabets\n        ans = (ans + solve(n-1,Math.max(0,l-1),e,t))%MOD; //place l\n        ans = (ans + solve(n-1,l,Math.max(0,e-1),t))%MOD; //place e\n        ans = (ans + solve(n-1,l,e,Math.max(0,t-1)))%MOD; //place t\n        return dp[n][l][e][t] = ans;\n    }\n}\n```
[]