For example,
# list A
A = [1, 2, 3, 3, 4, 4, 4, 5, 6]
# list B
B = [1, 2, 3, 3, 4, 5, 5, 5, 6]
are given, and we have to check if elements of the lists have the pattern of [x, x, y, y, y].
list A should return "True": [1, 2, 3, 3, 4, 4, 4, 5, 6]
list B should return "False" as '4' intercepts in the middle: [1, 2, 3, 3, 4, 5, 5, 5, 6]