Given two arrays, how do you check if one is a cyclic permutation of the other?
For example, given a = [1, 2, 3, 1, 5], b = [3, 1, 5, 1, 2], an
a = [1, 2, 3, 1, 5]
b = [3, 1, 5, 1, 2]
If A and B are cyclic permutations of each other, A will be found in doubled list BB (as will B in AA).