Precomputation || Brute Force || two pointer
Intuition\n Describe your first thoughts on how to solve this problem. \n    count how many element from a given index of s2 match whole \n    string of s1 that
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n    count how many element from a given index of s2 match whole \n    string of s1 that is for a single n1 , so we have to count \n    all n1 and just increse index of s2 . and add max match len.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n    count how many element from a given index of s2 match whole \n    string of s1 that is for a single n1 , so we have to count \n    all n1 and just increse index of s2 . and add max match len.\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n    O(N)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n    O(1)\n\n# Code\n```\nclass Solution {\npublic:\n    int getMaxRepetitions(string s1, int n1, string s2, int n2) {\n        int len1=s1.size(),len2=s2.size();\n        vector<int>inc(len2,0);\n        for(int i=0;i<len2;i++){\n            int ptr1=0,ptr2=i;\n            while(ptr1<len1){\n                if(s1[ptr1]==s2[ptr2%len2]){\n                    ptr1++;\n                    ptr2++;\n                }\n                else ptr1++;\n            }\n            inc[i]=ptr2-i;\n        }\n        int ptr=0,mx_match_len=0;\n        for(int i=1;i<=n1;i++){\n            mx_match_len+=inc[ptr];\n            ptr+=inc[ptr];\n            ptr%=len2;\n        }\n        return mx_match_len/(n2*len2);\n    }\n};\n```
['C++']