Question: python please problem 1. roblem 1 [12 points ] Maximum adjacent repeats. In some applications, such as in computational biology, it is necessary to find

python please
problem 1.
python please problem 1. roblem 1 [12 points ] Maximum adjacent repeats.
In some applications, such as in computational biology, it is necessary to

roblem 1 [12 points ] Maximum adjacent repeats. In some applications, such as in computational biology, it is necessary to find the maximum number of times that adjacent repeats of a particular substring occur in a string. For example, - in the string "abxxcabxaaaxcabxxxxc", the maximum number of adjacent repeats of the substring " x " is 4 and it starts at index 15. (The adjacent repeats of " x " are underlined here: "abxxcabxaaaxcabxxxxc".) - in the string "acababaxyzababababababdexayababababxyz", the maximum number of adjacent repeats of the subatring " ab " is 6 and it starts at index 10. (The adjacent repeats of "ab" are underlined here: "acababaxyzababababababdexayababababxyz".) Implement a function called max_adjacent repeats with two parameters: - text_atr, the main text string - search_atr, the substring whose maximum adjacent repeats in text_atr we want to find The finction shonk return two values the maximum number of aljacent repetitions of Bearch_str in text ber and the index of text_ptr at which that maximum starte. If the inaximam repetition occurs mutliple times in the string, your code dhould return the smallest: indes at which it oceurs. Two fample runs are shown below: Two samble rums are shown below: from problem 1 import * max adjacent_repeats ("abxxcabxaaaxcabxxxxc", "x") (4,15) (6, max adjacent_repeats ("acababaxyzababababababdexayababababxyz", "ab") (6,10) Important notes: You may not use the multiplication operator on strings in your implementation for this function; i.e., you may not use the strategy of checking if search_str * k (for some integer k) occurs in text_str

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!