Problems > Closed Walks on 2x3 Grid > Editorial

Closed Walks on 2x3 Grid — Solution & Editorial

Back to the Problem

The (1,1) entry of the adjacency matrix's N-th power via fast exponentiation.

Complexity: O(V3 log N)