C++ || Recursive DP
\nclass Solution {\npublic:\n    #define LL long long\n    const LL MOD = 1000000000 + 7;\n    \n    LL dp[100001][5];\n    \n    LL ans_me(int ix, int jump) {\
```\nclass Solution {\npublic:\n    #define LL long long\n    const LL MOD = 1000000000 + 7;\n    \n    LL dp[100001][5];\n    \n    LL ans_me(int ix, int jump) {\n        if (ix == 0) return 1;\n        LL &ret = dp[ix][jump];\n        if (ret != -1) return ret;\n        ret = 0;\n        for (int i = 1; i <= jump; i++) {\n            if (ix - i >= 0) {\n                ret = (ret + ans_me(ix - i, jump)) % MOD;\n            }\n        }\n        \n        return ret;\n    }\n    \n    int map_to_dig[10];\n    \n    int countTexts(string pressedKeys) {\n        memset(dp, -1, sizeof dp);\n        for (int i = 2; i < 10; i++) map_to_dig[i] = 3;\n        map_to_dig[7] = map_to_dig[9] = 4;\n        LL res = 1;\n        for (int i = 0; i < pressedKeys.size(); i++) {\n            int ix = i;\n            while(ix < pressedKeys.size() && pressedKeys[i] == pressedKeys[ix]) {\n                ix++;\n            }\n            int typ = map_to_dig[ pressedKeys[i] - \'0\' ];\n            res = (res * ans_me(ix - i, typ)) % MOD;\n            i = ix - 1;\n        }\n        \n        return res;\n    }\n};\n```
[]