✅✅✅||EASIEST BITMASK DP SOLUTION EVERY BEGINNER CAN UNDERSTAND||🔥🔥🔥
Intuition\n\nWhile solving the question the only problem i was facing was \nhow to make a 2^27 size mask as i assigned evey alphabet an index\n\nSOLUTION\n\nIT 
# Intuition\n```\nWhile solving the question the only problem i was facing was \nhow to make a 2^27 size mask as i assigned evey alphabet an index\n\nSOLUTION\n\nIT was unnecessary to assign each alphabet a space i only needed \n4 spaces \nL->           00[0]0\nE(first e) -> 000[0]\nE(second e)-> [0]000\nT->           0[0]00\n\nmax value = 1111\nnow my mask trimmed down from 2^27 to just 15\nnext using recusion i generate all possible strings\nand if my mask == 15, i return 1\nmask 15 means all char. are found.\n\neg: leet,teel, etel.... \nin case of n = 6 eetlab,eetlac.... i just check if i have l,e,e,t\n```\n\n# Complexity\n- Time complexity:\n    ~ o(n *26)\n- Space complexity:\n    ~ o(n*16)\n# Code\n```\nclass Solution {\npublic:\n    \n    int N;\n    int mod = (int) 1e9+7;\n    int dp[(int)1e5][16];\n    int solve(int idx,int mask){\n        \n        if(idx == N){\n            if(mask == 15){\n                return true;\n            }\n            return false;\n        }\n\n\n        if(dp[idx][mask] != -1){\n            return dp[idx][mask];\n        }\n\n        long long ans = 0;\n        for(char ch = \'a\';ch<=\'z\';ch++){\n            int i = ch - \'a\';\n            if(i == 4){\n                if(!(mask&(1<<0)) ){ // first e\n                    ans += solve(idx+1,mask|(1<<0))%mod;\n                }\n                else{ // second e\n                    ans += solve(idx+1,mask|(1<<3))%mod;\n                }\n            }\n            else if(i == 11){ // L\n                ans += solve(idx+1,mask|(1<<1))%mod;\n            }\n            else if(i == 19){ // T\n                ans += solve(idx+1,mask|(1<<2))%mod;\n            }\n            else{// None of them\n                ans += solve(idx+1,mask)%mod;\n            }\n        }\n        return dp[idx][mask] = ans%mod;\n    }\n    \n    int stringCount(int n) {\n        N = n;\n        memset(dp,-1,sizeof dp);\n        return solve(0,0);\n    }\n};\n```
['Dynamic Programming', 'Bit Manipulation', 'Memoization', 'Bitmask', 'C++']