First we recognize that given the conditions for the three selected squares, there are only 6 possible shapes that may be chosen. These are shown below.
![](https://cdn.mathpix.com/cropped/2024_04_20_748fdafcde2a47412608g-245.jpg?height=266&width=1388&top_left_y=2352&top_left_x=367)

To determine the number of ways that three squares can be selected, we count the number of ways in which each of these 6 shapes can be chosen from the given figure.

The results are summarized in the table below.

| Shape | $\square$ |  | $\square$ | $\square$ | $\square$ | $\square$ | $\square$ |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|  |  |  | $\square$ | $\square$ | $\square$ |  |  |
| Number  of  Each | 3 | 2 | 4 | 3 | 3 | 4 |  |

Thus, three of the nine squares can be selected as described in $3+2+4+3+3+4=19$ ways.

ANsWER: (A)
From the figure shown, three of the nine squares are to be selected. Each of the three selected squares must share a side with at least one of the other two selected squares. In how many ways can this be done?
(A) 19
(B) 22
(C) 15
(D) 16
(E) 20

![](https://cdn.mathpix.com/cropped/2024_04_20_46ead6524a8d61e21c51g-054.jpg?height=274&width=352&top_left_y=1939&top_left_x=1320)