Question: Write a function contains _ permutation that takes two inputs: input _ string : a string pattern: a string and returns True if input _

Write a function contains_permutation that takes two inputs:
input_string : a string pattern: a string
and returns True if input_string contains a substring (group of consequtive characters) that is a permutation of pattern and False otherwise. Your function must have a running time complexity of O(n), where n is the length of input_string.

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!