Ruby solution RT Beats 100%
Code\n\n# @param {String} s1\n# @param {Integer} n1\n# @param {String} s2\n# @param {Integer} n2\n# @return {Integer}\ndef get_max_repetitions(s1, n1, s2, n2, d
# Code\n```\n# @param {String} s1\n# @param {Integer} n1\n# @param {String} s2\n# @param {Integer} n2\n# @return {Integer}\ndef get_max_repetitions(s1, n1, s2, n2, dp = [])\n  s2.size.times do |i|\n    start, count = i, 0\n    s1.size.times do |j|\n      next if s1[j] != s2[start]\n      start += 1\n      start, count = 0, count + 1 if start == s2.length\n    end\n    dp << [start, count]\n  end\n\n  n1.times.inject([0, 0]) { |(total, idx), _| [total + dp[idx][1], dp[idx][0]] }.first / n2\nend\n\n```
['Ruby']