46 ms·
Cyclic lists might not be a good interview question, but working through some of the details is a great exercise. A good follow on from finding whether there i
by gsg 13y ago
Cyclic lists might not be a good interview question, but working through some of the details is a great exercise.
A good follow on from finding whether there is a cycle is finding the length of the lead-in and cyclic parts of the list, and then implementing a map function over cyclic lists. There are some interesting tricks that rely on non-obvious properties of cyclic lists.