Algorithm · Microsoft · Medium
Implement contains_repeated_pattern(items, pattern_length, repeat_count), which returns a boolean. The input consists of a list of case-sensitive strings items, a positive integer pattern_length, and an integer repeat_count that is at least 2. Determine whether items contains a contiguous run of repeat_count equal adjacent blocks, where each block has length pattern_length. A longer run also satisfies the condition if it contains at least the required number of consecutive…
Checking your access…