🚀 What Problem Are We Solving? (The Loop)

Imagine you are traveling through a sequence of steps (like nodes in a linked list, or numbers from a math formula). Eventually, you might enter a loop, where the steps just repeat forever.

The sequence looks like the Greek letter “Rho” : it has a straight Tail leading into a repeating Cycle (Loop).

Our goal is simple: Find the length of the repeating Cycle (lambda) and the length of the Tail (k) as quickly as possible.

ConceptWhat it isExample
Tail (k)The steps before the cycle starts.1, 2, 3 (3 steps)
Cycle (lambda)The sequence that repeats infinitely.4, 5, 6 (3 steps)
Full Sequence`1, 2, 3, 4, 5, 6, 4, 5, 6, 4, 5, 6, …

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help