On 01Aug2015 14:24, Lukas Barth <m...@tinloaf.de> wrote:
Perhaps I should clarify a bit:
- I definitely need a "canonical rotation" - just a comparison result is not
enough
Fine. This also eliminates any solution which just computes a hash.
- It does not matter what that rotation is. Starting with the smallest element
was just an idea by me, any rotation that can easily produced will do.
That's a fine way to start, but more work than is needed.
Might I suggest instead simply starting with the leftmost element in the first
list; call this elem0. Then walk the second list from 0 to len(list2). If that
element equals elem0, _then_ compare the list at that point as you suggested.
Is there an aspect of this which doesn't work?
Cheers,
Cameron Simpson <c...@zip.com.au>
--
https://mail.python.org/mailman/listinfo/python-list