We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
In my opinion, the editorial is needlessly complex. You can get the result more intuitively by using matrix exponentiation alone -- no need for dynamic programming or additional multiplications as seen in the editorial.
You'll of course have to find the transformation matrix, T. This is quite straightforward, especially if you do it in the usual way:
Towers
You are viewing a single comment's thread. Return to all comments →
In my opinion, the editorial is needlessly complex. You can get the result more intuitively by using matrix exponentiation alone -- no need for dynamic programming or additional multiplications as seen in the editorial.
You'll of course have to find the transformation matrix, T. This is quite straightforward, especially if you do it in the usual way:
Then the answer can be found like this:
This will be sufficient for every value of N.