Python 69ms solution
The main idea is to find a circle. A circle means m rounds of s1 has a subarray of n rounds of s2, and at the meantime starting from the same point of s1. \n\nc
The main idea is to find a circle. A `circle` means m rounds of s1 has a subarray of n rounds of s2, and at the meantime starting from the same point of s1. \n```\nclass Solution(object):\n    def getMaxRepetitions(self, s1, n1, s2, n2):\n        start = {} # s2_idx : s1_round, s2_round\n        s1_round, s2_round, s2_idx = 0, 0, 0\n        while s1_round < n1:\n            s1_round += 1\n            for ch in s1:\n                if ch == s2[s2_idx]:\n                    s2_idx += 1\n                    if s2_idx == len(s2):\n                        s2_round += 1\n                        s2_idx = 0\n            if s2_idx in start:\n                prev_s1_round, prev_s2_round = start[s2_idx]\n                circle_s1_round, circle_s2_round = s1_round - prev_s1_round, s2_round - prev_s2_round\n                res = (n1 - prev_s1_round) / circle_s1_round * circle_s2_round\n                left_s1_round = (n1 - prev_s1_round) % circle_s1_round + prev_s1_round\n                for key, val in start.iteritems():\n                    if val[0] == left_s1_round:\n                        res += val[1]\n                        break\n                return res / n2\n            else:\n                start[s2_idx] = (s1_round, s2_round)\n        return s2_round / n2\n```
[]