package leetcode;

/**
 * https://leetcode.com/problems/repeated-string-match/
 */
public class Problem686 {
    public int repeatedStringMatch(String A, String B) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem686 prob = new Problem686();
        System.out.println(prob.repeatedStringMatch("abcd", "cdabcdab")); // 3
    }
}

@@ -171,208 +171,326 @@
     
-// TODO%0A        return 0
+String a = A;%0A        int count = 1
 ;%0A    
+ 
-%7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem686 prob = new Problem686();%0A        System.out.println(prob.repeatedStringMatch(%22abcd%22, %22cdabcdab%22)); // 3
+   do %7B%0A            if (a.toString().contains(B)) %7B%0A                return count;%0A            %7D%0A            a += A;%0A            count++;%0A%0A        %7D while (a.length() %3C= B.length());%0A        if (a.toString().contains(B)) %7B%0A            return count;%0A        %7D%0A        return -1;
 %0A   

Solve problem 686