At DoorDash, you are given GPS points for a delivery region. Implement a function that returns the convex hull boundary of these points, including all points that lie on the boundary edges (not just the corner vertices).
points: list[list[int]] where each point is [x, y] (may contain duplicates).list[list[int]] of unique boundary points in counterclockwise (CCW) order, starting from the leftmost-lowest point.A point must be included if it lies on the perimeter of the convex hull (including collinear points along edges). Points strictly inside the hull must be excluded.
Example 1
points = [[0,0],[1,1],[2,2],[2,0],[2,4],[3,3],[4,2]][[0,0],[2,0],[4,2],[2,4]]Example 2
points = [[0,0],[1,0],[2,0],[3,0]][[0,0],[1,0],[2,0],[3,0]]1 <= len(points) <= 10^4-10^9 <= x, y <= 10^9points may contain duplicatespoints = [[0,0],[1,1],[2,2],[2,0],[2,4],[3,3],[4,2]]Output[[0,0],[2,0],[4,2],[2,4]]WhyOnly the outer quadrilateral corners are on the hull; the other points are strictly inside.points = [[0,0],[2,0],[2,2],[0,2],[1,0],[2,1],[1,2],[0,1]]Output[[0,0],[1,0],[2,0],[2,1],[2,2],[1,2],[0,2],[0,1]]WhyAll mid-edge points lie on the rectangle boundary and must be included in CCW order.1 <= len(points) <= 10^4-10^9 <= x, y <= 10^9points may contain duplicatesReturn unique boundary points in counterclockwise order starting from the leftmost-lowest pointdef convex_hull(points: list[list[int]]) -> list[list[int]]: