Skip to content

Add Solution for 142 Linked List Cycle II - #70

Open
kuangami wants to merge 1 commit into
masterfrom
Kuang-142
Open

Add Solution for 142 Linked List Cycle II#70
kuangami wants to merge 1 commit into
masterfrom
Kuang-142

Conversation

@kuangami

Copy link
Copy Markdown
Owner

// Suppose they first meet at step k, the length of the Cycle is r.
// so 2k - k = nr, let n = 1, we have k = r
// m is the distance between start node of the cycle and first meeting node
// need (r - m) step to reach the start node of the cycle

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

step -> steps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants