hope it helps!!!
See this: https://www.electrical4u.com/electrical-mcq.php?subject=digital-electronics&page=18
http://www.ece.ualberta.ca/~lkurgan/EE280/SN-15.pdf
AB, BC, CD...YZ require $25$ 2-input AND gates.
Then, we can OR all of them with a $single$ 25-input OR gate.
This is equivalent to using NAND gates of the exact same pattern. We will need $25$ 2-input NAND gates, and $1$ 25-input NAND gate.
So, 26 NAND gates.
See the image provided in Akash Dinkar's comment for clarity.
64.3k questions
77.9k answers
244k comments
80.0k users