Intersection of two linked lists that may have cycles
Given the heads of two singly linked lists, each of which may or may not contain a cycle, decide whether they share a node and return the first shared node. Find where each list's cycle starts (Floyd's algorithm). If neither has a cycle, use the usual length-difference method; if only one does, they cannot meet; if both do, they share the cycle only if one cycle entry can be reached from the other.
No answer yet. Write the first one; the best answer gets endorsed.
