How to remove 'circularly-similar' lists from a nested list. Two lists are 'circularly-similar' if they are the same after some circular rotation. For example
[1,2,3,4]
is circularly-similar to [3,4,1,2]
because [1,2,3,4]
rotated by 2 is [3,4,1,2]
Let's say I have the following list:
list = [[1, 1, 0], [0, 1, 1], [1, 1, 1]]
I would like to have [0, 1, 1]
removed, because it is circularly-similar to [1, 1, 0]
after rotation by 2. How should I approach this problem?