JS || Solution by Bharadwaj
Code\n\nvar getMaxRepetitions = function (s1, n1, s2, n2) {\n    let i2 = 0, doWhile = true, strCounter = 0, sumChars = 0, iterations = 0;\n    while (doWhile &
# Code\n```\nvar getMaxRepetitions = function (s1, n1, s2, n2) {\n    let i2 = 0, doWhile = true, strCounter = 0, sumChars = 0, iterations = 0;\n    while (doWhile && iterations < n1) {\n        for (let i1 = 0; i1 < s1.length; i1++) {\n            let char1 = s1[i1];\n            let char2 = s2[i2];\n            if (char1 === char2) {\n                sumChars++;\n                i2++;\n                if (sumChars === s2.length) {\n                    strCounter++;\n                    sumChars = 0;\n                    i2 = 0;\n                }\n            }\n        }\n        if (sumChars === 0) {\n            doWhile = false;\n        }\n        iterations++;\n    }\n    return ~~((strCounter / n2) * (n1 / iterations));\n};\n```
['JavaScript']