a = [3, 1, 2, 3, 4]
b = [3, 4, 3, 1, 2]
cyclic_equiv(a, b)
b = [3, 4, 3, 2, 1]
cyclic_equiv(a, b)
b = [3, 4, 3, 2]
cyclic_equiv(a, b)
cyclic_equiv([1, 2, 3], [1, 2, 3])
cyclic_equiv([3, 1, 2], [1, 2, 3])
Check if a list is a rotation of another list that works with duplicates