# Painting Squares

How many ways are there to paint a $$3\times3$$ grid with three colors such that each row and column has all three distinct colors?

Note: If you rotate the above illustration by $$90^\circ, 180^\circ$$ or $$270^\circ$$, they each count as different ways to paint the $$3\times3$$.

×