Question: Please do this is Python! Given a string Text, a pattern Pattern, and an integer overlap, we denote the size of the largest scattered set
Please do this is Python!
Given a string Text, a pattern Pattern, and an integer overlap, we denote the size of the largest scattered set of occurrences of Pattern in Text as Count(Text, Pattern, overlap). This provides an alternative to Count(Text, Pattern), which we used in the textbook to refer to the total number of occurrences of Pattern in Text (ignoring whether or not any overlaps existed). For example, when Text= GATATATATAC , Pattern = ATATA, and overlap =1,Count( Text, Pattern )=3 but Count( Text, Pattern, overlap )=2. Scattered Pattern Count Problem. Find the size of the largest scattered set of occurrences of a pattern in a text. - Input: A string Pattern, a string Text, and a positive integer overlap. - Output: Count(Text, Pattern, overlap). Implement a program that solves the Scattered Pattern Count Problem. Once you have solved this problem, please submit the code you used to solve this problem on Canvas. Hint. Depending on how you implemented the code for PatternCount, this problem may be solved with only small modifications to this code. But it is also not so difficult to solve it from scratch. Extra Example. When Text= , Pattern =, and overlap =3, the largest scattered set of occurrences of Pattern in Text has size 3 : GATATATATCATATATATATATG ATATAT ATATAT ATATAT
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
