L,H on the diagram below represent processor pins in LOW/HIGH states. LOW is 0v, HIGH -- 5V. Difference in voltage levels (5V vs 12V) leads to problems -- current flows on paths where it shouldn't. If I set the HIGH level to 12V, pins at the top of the diagram select the LED group and pins on the bottom the LED column, as expected.
How do I solve this incompatibility? One idea I have is to use multiple transistors at the top and at the bottom, but it requires 6 additional parts. Is there a more efficient solution?