findFreeArea = function( areas) {
const firstFreeArea = [];
for( const area of areas) {
const neighbours = h3.kRing( area, 1);
const freeNeighbour = neighbours.find(( neighbour, i) => {
return i > 0
&& !areas.includes( neighbour);
});
if( freeNeighbour) {
firstFreeArea.push( freeNeighbour);
break;
}
}
return firstFreeArea;
}