How many possible color combinations? I have a unusual shape like this.



I want to color its squares with 3 colors which no two adjacent(in vertical or horizontal) squares take the same color.

How should I solve such problems? Please give me a clear solution for given shape.

Thanks in advance :)
If you omit the 4 squares that are connected to only one other square, you are left with a rectangular 3x4 grid.

The number of 3-colourings of rectangular grids (divided by 3) is given in integer sequence A078099:

So, for the 3x4 grid, the answer is: $ 3 T(3,4) = 3 * 374 = 1122$

Now for the 4 extra squares, it's easy to see that for any of them, there are exactly 2 possibilities. So, the final answer for the specific grid is:

$ 2^4  1122 = 17952 $
overlay the pattern with a chess board to see how you can do it with two colours. Then in order to use three colours repaint one of the squares.