🔥Java Solution || Easy to Understand
java []\nclass Solution {\n    public int getMaxRepetitions(String s1, int n1, String s2, int n2) {\n        char[] ch1 = s1.toCharArray();\n        char[] ch2 
```java []\nclass Solution {\n    public int getMaxRepetitions(String s1, int n1, String s2, int n2) {\n        char[] ch1 = s1.toCharArray();\n        char[] ch2 = s2.toCharArray();\n\n        int i = 0, j = 0, count_s2 = 0;\n        while(n1 > 0) {\n            if(ch1[i] == ch2[j]) {\n                if(++j == ch2.length) { j = 0; count_s2++; }\n            }\n\n            if(++i == ch1.length) { i = 0; n1--; }\n        }\n\n        return count_s2 / n2;\n    }\n}\n\n\n```
['Java']