Problems > The Weird Algorithm > Editorial

The Weird Algorithm — Solution & Editorial

Back to the Problem

Simulate and print; intermediates exceed 32 bits.

Complexity: O(sequence length)