# Implementing function with NAND only quickest way

I'm trying to remind myself how to implement given function or karnaugh map with NAND or NOR gates. I remember how DeMorgan's laws work.

Let's say I have some Karnaugh Map and I want to implement the obtained function only with NAND gates.

To be efficient: should I group together zero's or one's? (Should I obtain PoS or SoP form of function to get to my result as fast as possible with least number of boolean algebra transformations?)

And same for NOR gates: should I group zero's or one's?

I understand that it all depends, but let's say that the Karnaugh Map is uniformly distributed with 0-s and 1-s and it is equally difficult (or easy) to group either.