Use recursion to implement a method int indexOf(String t) that returns the starting position of the first substring of the text that matches t. Return −1 if t is not a substring of s. For example,
Sentence s = new Sentence("Mississippi!");
int n = s.indexOf("sip"); // Returns 6
Hint: This is a bit trickier than the preceding problem, because you must keep track of how far the match is from the beginning of the sentence. Make that value a parameter of a helper method.