We want to build a wall with width W and height H where H and W are positive integers.
We use a list of brick to build a wall where each kind of brick_i has height 1 and width w_i. Each kind of brick has unlimited supply.
We build the wall layer by layer from bottom to top. To make sure the wall stable, for adjacent layers, the break point between bricks can not touch each other. For example, let's say W = 6 and H = 2. We have bricks of width 1 (denoted by A), 2 (denoted by BB), and 3 (denoted by CCC). The following wall is valid:
ABBCCC
BBCCCA
Where the following wall is not valid:
ABBCCC
CCCBBA
Not valid because the start of brick type C for height 2 is equal to the end of C for height 1.
Given H, W and w_i array output the number of ways to build the wall