Below is an example of a repeating cycle.
is_repeating_cycle([1, 2, 3, 1, 2], 3) ➞ True
# Since the first two elements of [1, 2, 3] equals [1, 2]
Below is an example of a non-repeating cycle.
is_repeating_cycle([1, 2, 3, 1, 3], 3) ➞ False
# Since [1, 2, 3] != [1, 3]
You are tasked with writing a function that takes in two inputs:
Return the boolean value True if the list is a repeating cycle, and False if the list is a non-repeating cycle.
is_repeating_cycle([1, 2, 3, 1, 2, 3, 1], 3) ➞ True
is_repeating_cycle([1, 2, 3, 4, 2, 3, 1], 4) ➞ False
is_repeating_cycle([1, 2, 1, 2, 2], 2) ➞ False
is_repeating_cycle([1, 1, 1, 1], 3) ➞ True
True if the cycle length is greater than the list length.