An entry in Fortnightly Topic Challenge #45: Flags

This grid deduction puzzle is a variation on the OP's previous Office Park puzzle. You are given a set of seven buildings, which are tetracubes, 3-dimensional shapes comprised of 4 cubes each, to place in a grid. Buildings must be placed without cantilevers, so there cannot be "air" underneath a hanging cube. Buildings must be placed so that no two buildings are touching, not even diagonally, and such that the empty squares form one orthogonally connected region.

But these are not just buildings...they are embassies of Albania, Morocco, Nigeria, Somalia, Tunisia, Ukraine, and Vietnam, and being embassies, each flies one instance of its national flag on a flagpole atop one segment of its building. You must also place the flags on each building.

There are two types of clues given which describe the arrangement of the embassies and flags. The numeric clues indicate the number of buildings that can been "seen" looking along the associated row/column. A building is seen if one of its cubes, or its flag, is the first item at its height or higher to occur when looking down the row/column; treat flags as being half as high as cubes, so that a flag on a 1 cube high segment obscures another flag on a 1 cube high segment behind it, but not a 2 cube high segment.

The color clues indicate a color seen on the highest flag visible from that direction along the row/column, which may or may not be the first flag seen in that direction. The color indications are:

  • R - red
  • G - green
  • Y - yellow
  • W - white
  • BL - blue
  • BK - black
  • NF - no flag is visible from this vantage point

As an example, we might have the following embassy placement and cluing: enter image description here

[For the color blind, the 1 in column one is shaded yellow and blue to indicate Ukraine's flag, the 2 in column five is shaded white and green to indicate Nigeria's flag, and the 1 in column eight is shaded black and red to indicate Albania's flag.]

From the left, only one building is visible (even though we see two different tiers of it). The only flag visible from the left is Ukraine's, and yellow is one of the colors on it. From the right we can see three buildings: 1+ of the Albanian embassy, 2+ of the Nigerian embassy, and 3 from the Ukrainian embassy. The highest flag seen from the right is Nigeria's (being on a 2 cube high stack), so green is a color seen in it.

Ready? Here's the grid to be solved:


Solver Helps


There is some easy flag logic you can do without placing any buildings, but then try to place the I. The rows are the key, since there are only 7 buildings.


  1111 or 4

  31 or 112 or 111

  22 or 11

  121 or  1

V (this is the one that has left- and right-handed versions)
  12 or 11
  1     2


  11  or  11
   11    11


      G |N F| W |N F|N F| Y |N F| R 
      2 |   |   |   |   |   |   |   
G   |   |   |   |   |   |   |   |   |1 W
NF  |   |   |   |   |   |   |   |   |3 BL
NF  |   |   |   |   |   |   |   |   |1 NF
R  1|   |   |   |   |   |   |   |   |  Y 
BL  |   |   |   |   |   |   |   |   |3 R 
NF  |   |   |   |   |   |   |   |   |  NF
R   |   |   |   |   |   |   |   |   |3 R 
R   |   |   |   |   |   |   |   |   |2 BK
        |   | 2 |   | 2 | 2 |   | 1
      R |N F|B K|N F| R |B L|N F| Y
  • $\begingroup$ Is the flag included in the segment? ie will a 1 + flag segment obscure a 2 + no flag segment? Thanks $\endgroup$ Commented Dec 21, 2020 at 16:17
  • 1
    $\begingroup$ @OmegaKrypton Yes, a flag is included, at half height. So a 1+ flag segment will not block a 2 segment with no flag. $\endgroup$ Commented Dec 21, 2020 at 16:19

1 Answer 1


First of all,

Note that both R8 and C3 see a black flag, but there is only one black flag: Albania. Therefore, Albania must be in R8C3.

Note that on the right side, 6 of the 8 rows see a flag, so 6 of the flags must be in those rows. Next, note that R5 sees a flag with Blue colour from the left side but a red flag from the right side. However, from the given list, there is no such flag with such a colour combination. Therefore, the last missing flag must be in R5.

This means that the Red and Yellow flag that is seen in R4 must be the Vietnam flag. Now, look at Column 8, where there is also another RY combination. If the flag seen from the top and bottom were different, it would cause a contradiction: A flag cannot go in R2,3,5,6,7,8 because it would either not fulfil the requirements of a number or be in a row with NF. It cannot go in row 1 because that row sees G and W and placing R there would force 2 flags in row 1. Therefore, the flag that C8 sees is the same as R4 and the Vietnam flag is at R4C8. Grey squares can then be used to mark out places that cannot contain a tetracube.


Since there is a Yellow in C6, the Ukraine flag must be somewhere there, as it is the only flag left with Yellow. For similar reasons as before, we can rule out R1,3,4,6,7,8. It also cannot go in R5 because a red flag must be seen from the right side. Therefore, it must be in R2.

Then, in Row 7, the same flag is seen from opposite ends. So, this flag must be the highest point in that row. Therefore, it cannot occupy C4-8 as it will cause the 3 on the right side to see only 2 blocks at most. It cannot occupy C2-4 since it will touch the Albania flag. Therefore, that flag goes into R7C1. We are still not sure whether this is Morocco or Tunisia. Then, the red flag in C5 can only go into R5C5.


Step 2:

Now, it is time to use some block logic. There are 3 different rows that each see 3 tetracubes, but there are only 7 such blocks. That means they must share at least 2 buildings among them. By placing 5 flags, we know the positions of 5 blocks. We also know where the remaining two blocks are. One is in R5C1-3 to satisfy the 'BL' flag, while the other one is in somewhere in R1 to satisfy the 'G/W' flag.

Now, we try to place the 'I' block. We cannot place an 'I' anywhere except for the Vietnam flag. But which pair of '3' rows does it cross? If we try to place it at R4-7, then the '3' in row 2 would need 2 more tetracubes. But the top left area can only accommodate one more tetracube. Therefore, the 'I' must go to R2-5. Also, since the 'I' is used up, some of the squares in the lower right corners cannot be reached anymore.


Step 3:

Next, observe that the unknown tetracube in R5 must use R5C2 no matter what. Therefore, the cells below it are unusable. Additionally, in R5, there must be a "wall" between the 'R' flag and 'BL' flag, which is the final tetracube that R5 from the right sees. Because of this, the flag cannot be in R5C3. The white flag in C3 must therefore be in R1C3 and it is the Nigeria flag. The flag in R7C1 must be seen from the right side so, this means the tetracube in the lower-left must be the 'O' tetracube in the "2 2" configuration. The Green flag that C1 sees from the top must belong to this O group as well, so this must be the Morocco flag and the one in R5C5 is the Tunisia flag.


Step 5:

Now, consider R7. Since its final tetracube has a height of 2.5, and there are no other flags in that row, it must see a height of 1 and 2 somewhere. This means the tetracube with a height 2 must be associated with the Albania flag, and it must therefore be a 'V' or 'W' cube. The Albanian flag must also be on a height of 1

Then, we can focus on how to satisfy C5. There cannot be another tetracube in the bottom area of C5, so C5 must be satisfied using the Tunisia and Ukraine tetracubes. This means that the Tunisia flag must be on a block of height 1, and then it sees a block of height 2 from the Ukraine tetracube. This height of 2 cube cannot be in R3 as it will violate the right side condition of that row. Hence, it must be in R2.

However, now in order to satisfy the conditions of R2, there must be a block of height '3' somewhere in R2. Hence, the Nigeria embassy is an 'L' block. The progress so far:


Step 6:

Now, the Tunisia embassy can only be the 'S' piece as no other embassy can be this piece. This forces the Albanian embassy to be the 'V' piece, which in turn forces the Ukrainian embassy to be the 'W' piece. The last remaining piece, 'T', belongs to the Somalian embassy. Now, we can place the remaining pieces and we are done.


  • $\begingroup$ Well done! With great diagrams! I hope you enjoyed...this one definitely felt harder than some of the other grid deduction puzzles I've done. $\endgroup$ Commented Dec 22, 2020 at 17:12
  • $\begingroup$ @JeremyDover Yeah, the break-in was a lot harder, but it was so satisfying when I finally figured it out. I'm still not sure if there was an easier approach compared to mine. $\endgroup$
    – Alaiko
    Commented Dec 22, 2020 at 17:13
  • 1
    $\begingroup$ Your approach was comparable in difficulty to mine. I ended up doing things in a different order, but we had essentially all the same steps. Figuring out where the I goes is definitely the key to the whole thing, and I don't know that there's an easier way than elimination. I originally had the bottom right row color red...it still works, but the grind on the I is quite a bit tougher. $\endgroup$ Commented Dec 22, 2020 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.