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.
Main points to take care about are:
1) calculate total number of combination per row using dynamic programming
2) inclusion/exclusion concept by splitting the wall on 2 parts - use dynamic programming for better performance
3) Fast/binary exponentiation by squaring the base and halving the exponent
Lego Blocks
You are viewing a single comment's thread. Return to all comments →
Main points to take care about are: 1) calculate total number of combination per row using dynamic programming 2) inclusion/exclusion concept by splitting the wall on 2 parts - use dynamic programming for better performance 3) Fast/binary exponentiation by squaring the base and halving the exponent
Java code