Geez. Mad coz bad. /\
\n# Code\n\nclass Solution:\n    def getMaxRepetitions(self, s1: str, n1: int, s2: str, n2: int) -> int:\n        if n1 == 0:\n            return 0\n\n        #
\n# Code\n```\nclass Solution:\n    def getMaxRepetitions(self, s1: str, n1: int, s2: str, n2: int) -> int:\n        if n1 == 0:\n            return 0\n\n        # Count the number of occurrences of s2 in each repetition of s1\n        repeat_count = {}  # Map of count2: (count1, next_index)\n        count1, count2 = 0, 0\n        next_index = 0\n\n        while count1 < n1:\n            for i in range(len(s1)):\n                if s1[i] == s2[next_index]:\n                    next_index += 1\n                    if next_index == len(s2):\n                        next_index = 0\n                        count2 += 1\n\n            count1 += 1\n\n            if next_index in repeat_count:\n                # Found a repeating pattern\n                prev_count1, prev_count2 = repeat_count[next_index]\n                pattern_count1 = count1 - prev_count1\n                pattern_count2 = count2 - prev_count2\n                pattern_repetitions = (n1 - prev_count1) // pattern_count1\n                remaining_count1 = (n1 - prev_count1) % pattern_count1\n\n                count2 = prev_count2 + pattern_count2 * pattern_repetitions\n                count1 = prev_count1 + pattern_count1 * pattern_repetitions\n\n                # Calculate remaining occurrences within the partial pattern\n                for _ in range(remaining_count1):\n                    for char in s1:\n                        if char == s2[next_index]:\n                            next_index += 1\n                            if next_index == len(s2):\n                                next_index = 0\n                                count2 += 1\n\n                break\n            else:\n                repeat_count[next_index] = (count1, count2)\n\n        return count2 // n2\n\n```
['Python3']