AMC8 2022 Problem 23

A \triangle or \circ is placed in each of the nine squares in a 3 \times 3 grid. Shown below is a sample configuration with three \triangle's in a line.

\begin{array}{|c|c|c|} \hline \triangle & \circ & \circ \\ \hline \circ & \triangle & \circ \\ \hline \circ & \circ & \triangle \\ \hline \end{array}

How many configurations will have three \triangle's in a line and three \circ's in a line? To determine the number of configurations with three \triangle's in a line and three \circ's in a line?

A. 39
B. 42
C. 78
D. 84
E. 96