0469. Convex Polygon
Last updated
Last updated
https://leetcode.com/problems/convex-polygon
You are given an array of points on the X-Y plane points
where points[i] = [xi, yi]
. The points form a polygon when joined sequentially.
Return true
if this polygon is convex and false
otherwise.
You may assume the polygon formed by given points is always a simple polygon. In other words, we ensure that exactly two edges intersect at each vertex and that edges otherwise don't intersect each other.
Example 1:
Example 2:
Constraints:
3 <= points.length <= 104
points[i].length == 2
-104 <= xi, yi <= 104
All the given points are unique.