Beats 100% Two pointer and using cache to multiply
IntuitionUsing cache checking if the process is repeated to minimize progress.Approach
Check charactor from s1 and s2 to minimize process

Remove charactors are
# Intuition
Using cache checking if the process is repeated to minimize progress.

# Approach
- Check charactor from s1 and s2 to minimize process
    + Remove charactors are not existed in s2
    + Check if s1 missing any charactor in s2
    + Check if s1 equal s2
    
- Two pointer loop from start to end of s1*n1 and s2 to check `n` repetitions
    + Loop s1 * n1 and check if charactor in s2 appear in s1
    + While s2 go to end caching end index and check if repeation occurs
    + If repeation occurs multiply result and go to last process
- Calculate result = n/n2

# Complexity
- Time complexity: ~ O(log(n)
- Space complexity: O(1)

# Code
```golang []

func getMaxRepetitions(s1 string, n1 int, s2 string, n2 int) int {
	ck := make([]int, 26)
	for i := range s2 {
		ck[s2[i]-'a'] = 1
	}
    //using for removing charactor that not exits in s2
	s11 := make([]byte, 0)
	ck1 := make([]int, 26)
    //last index equal s2[0]
	iL := -1
	for i := range s1 {
		if ck[s1[i]-'a'] == 1 {
			s11 = append(s11, s1[i])
			ck1[s1[i]-'a'] = 1
		}
		if s1[i] == s2[0] {
			iL = i
		}
	}
    //check if s2 has charactor that not exits in s1
	for i := range ck {
		if ck[i] == 1 && ck1[i] == 0 {
			return 0
		}
	}
	s1 = string(s11)
    //check if s1 equal s2 -> return
	if s1 == s2 {
		return n1 / n2
	}
	j := 0
	n := 0
	mapCheck := make(map[int][2]int)
	for in := 1; in <= n1; in++ {
		for i := 0; i < len(s1); i++ {
			if s1[i] == s2[j] {
				j++
			}
			if j == len(s2) {
				j = 0
				n++
                //check if the folowing interval start at in + 1 (i + 1 to end can not start)
				if iL < i+1 {
					n *= n1 / in
					in = n1 - n1%in
					continue
				}
                //caching and check if end point i is repeated -> multiple result
				ck, ok := mapCheck[i]
				if !ok {
					mapCheck[i] = [2]int{in, n}
				} else {
					nadd := n - ck[1]
					inAdd := in - ck[0]
					n += ((n1 - in) / inAdd) * nadd
					in = n1 - (n1-in)%inAdd
				}
			}
		}
	}
	return n / n2
}
```
['Go']