Java Solution
\nclass Solution {\n    public int getMaxRepetitions(String s1, int n1, String s2, int n2) {\n        if(s1==null || s2==null || s2.length()*n2 > s1.length()*n1
```\nclass Solution {\n    public int getMaxRepetitions(String s1, int n1, String s2, int n2) {\n        if(s1==null || s2==null || s2.length()*n2 > s1.length()*n1) return 0;\n        if(s2=="") return 0;\n        \n        int str2Index = 0;\n        int count = 0;\n        int k=0;\n        while(k<n1)\n        {\n            for(int i=0;i<s1.length();i++){\n                if(s1.charAt(i)==s2.charAt(str2Index))\n                    str2Index++;\n                if(str2Index==(s2.length())){\n                    str2Index=0;\n                    count++;\n                }\n            }\n            k++;\n            if(str2Index==0)\n            {\n                if(n1%2==0 || n1 < 2)\n                    count*=n1/k;\n                else\n                    count=(count*(n1-1)/k)+1;\n                break;\n            }\n        }\n\n        return count/n2;\n    }\n}\n\n```
['Java']