Brute force solution not following the editorial. Easy to understand.
IntuitionWe try brute force approach, but to shorten our calculations we shall check if at any point some number of s2 string is contained in integer (whole) nu
# Intuition
We try brute force approach, but to shorten our calculations we shall check if at any point some number of s2 string is contained in integer (whole) number of s1 string.

Not best performance, but at least easy to understand what is going on...

# Complexity
- Time complexity: O(x), where x is determined by LCM(s1.Length, s2.Length) and GCD(s1.Length * n1, s2.Length * n2).
- Space complexity: O(1).

# Code
```csharp []
public class Solution {
    public int GetMaxRepetitions(string s1, int n1, string s2, int n2) {
        int ind1 = 0, ind2 = 0;
        int lmod = s2.Length, l1 = s1.Length;
        // ind1 - position in first "long" string, ind2 - in second
        while(ind1 < l1 * n1){
            if(s2[ind2%lmod] == s1[ind1%l1]) ind2++;
            ind1++;
            if (ind2%lmod == 0 && ind1%l1 == 0){
                int repeats = (l1 * n1) / ind1;
                ind1 *= repeats;
                ind2 *= repeats;
            }
        }
        // ind2 - total chars founded
        return ind2 / (lmod * n2);
    }
}
```

And C++ variation also:
```
class Solution {
public:
    int getMaxRepetitions(string s1, int n1, string s2, int n2) {
        int ind1 = 0, ind2 = 0;
        int lmod = s2.length(), l1 = s1.length();
        // ind1 - position in first "long" string, ind2 - in second
        while (ind1 < l1 * n1) {
            if (s2[ind2 % lmod] == s1[ind1 % l1]) ind2++;
            ind1++;
            if (ind2 % lmod == 0 && ind1 % l1 == 0) {
                int repeats = (l1 * n1) / ind1;
                ind1 *= repeats;
                ind2 *= repeats;
            }
        }
        // ind2 - total chars found
        return ind2 / (lmod * n2);
    }
};
```
['String', 'C++', 'C#']