A polygon P determined by points p1, p2, . . . , pn is a closed chain of line segments (callededges) p1p2, p2p3, . . . , pnp1 in the plane. Polygon P is simple, if no two edges have any pointsin common, with the obvious exception of two consecutive segments having one common point(called vertex). Note however, that if a vertex is part of any other (third) edge, the polygon isno longer simple.Any polygon that is not simple is called self-intersecting. In two example figures below, the firstpolygon is simple, the second one is self-intersecting
Your task is to determine whether a given polygon is simple or self-intersecting