My Simple Easy to Understand Java Memoization solution with out using HashMap
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\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    int mod=((int)Math.pow(10,9)+7);\n    public int countTexts(String press) {\n        int dp[]=new int[press.length()+1];\n        Arrays.fill(dp,-1);\n        return recur(0,press,dp);\n        \n    }\n    int recur(int i,String press,int dp[]){\n        if(i==press.length()){\n            return 1;\n        }\n        if(dp[i]!=-1) return dp[i];\n        int c=0;\n        int o1=recur(i+1,press,dp);\n        int o2=0;\n        if(i<press.length()-1 &&  press.charAt(i)==press.charAt(i+1)){\n            o2=recur(i+2,press,dp);\n        }\n        int o3=0;\n        if(i<press.length()-2 &&  press.charAt(i)==press.charAt(i+1) &&  press.charAt(i)==press.charAt(i+2)){\n            o3=recur(i+3,press,dp);\n        }\n        int o4=0;\n        if(i+3<press.length() && (press.charAt(i)==\'7\' || press.charAt(i)==\'9\') && press.charAt(i)==press.charAt(i+1) &&  press.charAt(i)==press.charAt(i+2) && press.charAt(i)==press.charAt(i+3) ){\n            o4=recur(i+4,press,dp);\n\n    }\n    c=(((((o1+o2)%mod)+o3)%mod)+o4)%mod;\n    return dp[i]=c;\n}\n}\n```
['Java']