Search⌘ K
AI Features

Solution: Convex Polygon

Explore how to determine if a given polygon is convex by using the cross product of vectors formed by consecutive points. This lesson teaches you to analyze the direction of turns throughout the polygon to confirm convexity, with a clear algorithm and efficient time and space complexity.

Statement

You are given an array of points on the XY plane, where each point is represented as points[i] = [xi, yi][x_i, \space y_i] ...