Problems > Counting Euclid's Steps > Editorial

Counting Euclid's Steps — Solution & Editorial

Back to the Problem

Simulate the algorithm literally and count iterations — Fibonacci pairs maximize the count (≈ 87 steps at this limit).

Complexity: O(log min(A, B))