Is [4,5,9,8,12,7] an acceptable solution or not?
It adheres to the two conditions listed: Each side of this figure coincides with an edge in the grid. And all sides of the figure have the same length.
Yet, it is definitely not a hexagon...