[Community Puzzle] Number of triangles enclosing X - Puzzle discussion

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @nguyen.lam,validated by @JeZzElLutin,@kayou and @Dr_Meyss.
If you have any issues, feel free to ping them.

Part of your code can be reused between this puzzle and Triangle toggle puzzle.