Working on some interesting combination problems related to Lego blocks. For example, this one. Confusion is, I often see two dimensions (e.g. height and width in below problem) mentioned to calculate the number of combinations, so length needed to mention in such problems?
https://www.hackerrank.com/challenges/lego-blocks
You have 4 types of lego blocks, of sizes (1 x 1 x 1), (1 x 1 x 2), (1 x 1 x 3), and (1 x 1 x 4). Assume that you have an infinite number of blocks of each type.
Using these blocks, you want to make a wall of height N and width M. The wall should not have any holes in it. The wall you build should be one solid structure. A solid structure can be interpreted in one of the following ways: (1)It should not be possible to separate the wall along any vertical line without cutting any lego block used to build the wall. (2)You cannot make a vertical cut from top to bottom without cutting one or more lego blocks.
- It should not be possible to separate the wall along any vertical line without cutting any lego block used to build the wall.
- You cannot make a vertical cut from top to bottom without cutting one or more lego blocks.
The blocks can only be placed horizontally. In how many ways can the wall be built?
regards, Lin