Improve the previous Design Honeycomb structure

You must learn a programming language (C# Python …). You have to work with an array for each cell saying if cell is taken or not.
Begin by a cell, try to find “n” cells aligned
if Yes update the array with the cells taken and the neighbors, continue until there is no place.
You also have to understand topology. It could certainly be simple with Mesh. Look at my nColor script. It could help you.