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.
Isn`t there a single O(1) math solution for this?
I could only find a formula for a width (m) < 5, which would be:
((2^n)-1)^(m-1)
(no matter what the height (n). But for m>=5 i couldnt find any formula.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Lego Blocks
You are viewing a single comment's thread. Return to all comments →
Isn`t there a single O(1) math solution for this? I could only find a formula for a width (m) < 5, which would be: ((2^n)-1)^(m-1) (no matter what the height (n). But for m>=5 i couldnt find any formula.