Python Regex Overlapping Triangles Geometry Solution