package leetcode;

/**
 * https://leetcode.com/problems/occurrences-after-bigram/
 */
public class Problem1078 {
    public String[] findOcurrences(String text, String first, String second) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1078 prob = new Problem1078();
    }
}

@@ -12,16 +12,68 @@
 tcode;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0A
 /**%0A * h
@@ -249,132 +249,416 @@
     
-// TODO%0A        return null;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem1078 prob = new Problem1078(
+List%3CString%3E answer = new ArrayList%3C%3E();%0A        String%5B%5D words = text.split(%22%5C%5Cs%22);%0A        int i = 0;%0A        while (i %3C words.length - 1) %7B%0A            if (words%5Bi%5D.equals(first) && words%5Bi + 1%5D.equals(second)) %7B%0A                if (i + 2 %3C words.length) %7B%0A                    answer.add(words%5Bi + 2%5D);%0A                %7D%0A            %7D%0A            i++;%0A        %7D%0A        return answer.toArray(new String%5B0%5D
 );%0A 

Solve problem 1078