Approach hintTry it first, then revealHide
Count the valid digits for even and odd positions separately; the answer is a product of two large powers, which recursive fast exponentiation computes in O(log n) modulo 10^9 + 7.
Count the valid digits for even and odd positions separately; the answer is a product of two large powers, which recursive fast exponentiation computes in O(log n) modulo 10^9 + 7.