Question: Problem#3. Write a recursive method called isPatternStringOf that accepts two parameters, a string of characters, str, and a length of a pattern, n. The method

Problem#3. Write a recursive method called isPatternStringOf that accepts two parameters, a string of characters, str, and a length of a pattern, n. The method will return a Boolean value which indicate whether the string is entirely composed of repeated occurrences a pattern of length n or not. The method returns true only if the string is entirely formed of repeated occurrences of a substring of length n. Otherwise, it returns false. Consider the following output examples: Example 1: Command: isPatternStringOEN abcdabcd 4 Output: abcdabcd is a composed of a pattern of size 4 Example 2: Command: isPatternStringon abcdabcd 3 Output: abcdabcd is not composed of a pattern of size 3 Example 3: Command: isPatternStringOEN abcdabcde 4 Output: abcdabcd is not composed of a pattern of size 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
