Skip to main content
2 of 3
added 41 characters in body
l4m2
  • 28.5k
  • 2
  • 25
  • 104

JavaScript (Node.js), 88 86 bytes

a=>g=(x,y,c=0)=>a.map((p,i)=>p.map((q,j)=>c+=q-8?0:1/y?(x-j)**2+y*y<3:g(j,i)<2,y--))|c

Try it online!

Thank Arnauld for 2 bytes

l4m2
  • 28.5k
  • 2
  • 25
  • 104