Question: FULL JAVA CODE PLEASE Given a String x, a substring m from x and a number n, write a recursive method (no loops) to check

FULL JAVA CODE PLEASE

Given a String x, a substring m from x and a number n, write a recursive method (no loops) to check if at least n copies of the substring m appear in the String x. You should call your method checkForSub. checkForSub should take in 2 Strings and an Integer value and return a Boolean.

For Example:

checkForSub("catcowcat", "cat", 2) -> true

checkForSub("catcowcat", "cow", 2) -> false

checkForSub("catcowcat", "cow", 1) -> true

Input

 x, m, n, where x and m are Strings, n is an Integer 

Sample Input

 catcowcat cat 2 

Output

 A Boolean value 

Sample Output

 true

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!