15,664,273 members
1.00/5 (1 vote)
See more:
```I'm looking for an approach to this problem where you have to fill a NxM (N!=M) piece matrix with L-shaped three piece tiles. More accurate to say it s that every element of the matrix is a square and with an L-shaped i cover 3 elements .  [EXEMPLE][1]
I would like a full solve if possible . (C/C++/PYTHON)

[1]: https://i.stack.imgur.com/gCC7h.png```

What I have tried:

i created a matrix with N*M size , filled it with value 0 and then when a L-shaped piece is placed to change the values of the matrix to 0
Posted
Updated 27-Aug-20 14:10pm
F-ES Sitecore 27-Aug-20 13:32pm
If you're looking for someone to write code for you try a freelancer website.
Patrice T 27-Aug-20 13:36pm
What have you done, what is the problem ?
Member 14924606 27-Aug-20 13:47pm
i can t find out how to continue solving
jeron1 27-Aug-20 13:49pm
Can you solve it on a piece paper?
Have you written any code?

## Solution 1

I see you have posted this same query in atleast three forums.

By now you know its a broad topic and since you are asking for some direction to start in comments here (and at SO), take a cue from this: combinatorics - How many ways can you tile an NxM rectangle with L-polyominos? - Mathematics Stack Exchange[^]

Try out.

## Solution 2

I would write numbers in the squares to indicate which shape it is part of with zero being empty. The first shape will be number one, the second will be two, and so on. The part I am uncertain of how do you distinguish between attempts? One possibility is too have a second variable for each square that indicates the orientation of the shape in it for the corner piece of the L. Since each one can have four possibilities that defines the number of possible options. Some combinations will be impossible because the square is already occupied by a different object and can't be a corner piece.

With three-piece shapes it is really rather simple. For a challenge - try it with four piece shapes.