How to solve "Lego Blocks" on HackerRank

T he challenge is to find the number of possible walls of width w w w and height h h h made up of 4 different width Lego blocks, with no complete vertical breaks anywhere within. It turns out that there are actually two challenges here: one mathmatical and one technological. Let’s start with the mathematical one. The mathmatical challenge The mathmatical challenge is fairly straightforward: how do…