Best C# solution
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```\n//using System;\n//using System.Collections.Generic;\n\npublic class Solution\n{\n    public int GetMaxRepetitions(string s1, int n1, string s2, int n2)\n    {\n        List<int> rec = new List<int> { 0 };\n        Dictionary<int, int> track = new Dictionary<int, int>();\n        int ct = 0, start = 0, ptr1 = 0, ptr2 = 0;\n\n        if (!IsSubset(s2, s1))\n            return 0;\n\n        s1 = new string(s1.Where(ch => s2.Contains(ch)).ToArray());\n\n        while (true)\n        {\n            \n            foreach (char ch in s2)\n            {\n                ptr1 = s1.IndexOf(ch, start);\n                if (ptr1 == -1)\n                {\n                    ct++;\n                    ptr1 = s1.IndexOf(ch);\n                }\n                start = ptr1 + 1;\n            }\n\n            rec.Add(ct + 1);\n\n            if (rec[^1] > n1)\n                return (rec.Count - 2) / n2;\n\n            ptr1 = start;\n\n            if (!track.ContainsKey(ptr1))\n                track[ptr1] = rec.Count - 1;\n            else\n                break;\n        }\n\n        int cycleStart = rec[track[start]];\n        int cycle1 = ct + 1 - cycleStart;\n        int cycle2 = rec.Count - 1 - track[start];\n        int rest = n1 - cycleStart;\n        int rem = cycleStart + rest % cycle1;\n\n        ptr2 = 0;\n        while (rec[ptr2] <= rem)\n            ptr2++;\n\n        return (cycle2 * (rest / cycle1) + ptr2 - 1) / n2;\n    }\n\n    private bool IsSubset(string s2, string s1)\n    {\n        foreach (char ch in s2)\n        {\n            if (s1.IndexOf(ch) == -1)\n                return false;\n        }\n        return true;\n    }\n}\n\n```
['C#']