Michael M. answered 08/03/22
Game Programmer and programming hobbyist
I would start by centering 1 hexagon in the circle and making sure that fits. Because hexagons stack nicely, you can add a circle of hexagons around it. For each additional hexagon, do the same, making sure you don't overlap hexagons, and that you only check each hexagon once.
This is a breadth-first search problem. It's similar to how Minesweeper determines adjacent empty tiles.