Search
⌘K

Leetcode 3337. Total Characters in String After Transformations II

Model the process as a linear map on a 26-dimensional vector of letter counts (each letter expands into a fixed set of next letters), then compute the total length after t steps by raising the 26×26 transition matrix to the t-th power and applying it to the initial counts, taking the result modulo 10^9+7.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.