Easy Dp solution : JAVA
\n    public int countTexts(String s) {\n        int n =s.length();\n        long dp [] =new long[n+1];\n        dp[0]=1;\n        int mod = 1000000007;\n      
```\n    public int countTexts(String s) {\n        int n =s.length();\n        long dp [] =new long[n+1];\n        dp[0]=1;\n        int mod = 1000000007;\n        for(int i=1;i<=n;i++)\n        {\n            char ch = s.charAt(i-1);\n        \n               dp[i]= (dp[i] + dp[i-1]) % mod;     \n                   \n                if((i-2)>=0 && s.charAt(i-2)==ch) dp[i] = (dp[i] + dp[i-2]) % mod;\n                else continue;\n                \n                if((i-3)>=0 && s.charAt(i-3)==ch) dp[i]= ( dp[i]+dp[i-3] )  % mod;\n                else continue; \n                \n                if( (ch==\'7\' || ch==\'9\') && (i-4)>=0 && s.charAt(i-4)==ch) dp[i] = (dp[i]+dp[i-4] )  % mod;     \n            \n        }\n        \n        return (int)(dp[n] % mod);\n    }\n```
[]