Problems > Strings Without Adjacent Ones > Editorial

Strings Without Adjacent Ones — Solution & Editorial

Back to the Problem

The count is the Fibonacci number F(N+2); use matrix exponentiation for astronomical N.

Complexity: O(log N)