There is a solution in ts
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```\nfunction getMaxRepetitions(s1: string, n1: number, s2: string, n2: number): number {\n    let idx2 = 0;\n\n    let doWhile = true;\n    let strCounter = 0;\n    let sumChars = 0;\n    let iterations = 0;\n    while (doWhile && iterations < n1) {\n        for (let idx1 = 0; idx1 < s1.length; idx1++) {\n            const char1 = s1[idx1];\n            const char2 = s2[idx2];\n            if (char1 === char2) {\n                sumChars++;\n                idx2++;\n                if (sumChars === s2.length) {\n                    strCounter ++;\n                    sumChars = 0;\n                    idx2 = 0;\n                }\n            }\n        }\n        if (sumChars === 0) {\n            doWhile = false;\n        }\n        iterations++;\n    }\n    return Math.floor((strCounter / n2) * (n1 / iterations));\n}\n```
['TypeScript']