Question: How can I optimize the processing of strings?

Answer: 
Your problem is you are making n copies of t and concatenating them. This is a simple approach, but quite expensive - it turns what could be an O(n) solution into an O(n2) one.

Instead, just check each char of s:

```
for (int i = 0; i < s.length(); i++) {
    if (s.charAt(i) != t.charAt(i % t.length())) {
        return -1:
    }
}

```
* Do not make new strings, but use String.regionMatches.
* Use String.length and modulo % == 0.
* The smallest substring of t can be done using the same method.

Coding:

* new String(string) ist **never** needed.
* String += is slow. Better use StringBuilder.

No code to not spoil your coding.