Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Compute Convex Hull Boundary

HardPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Compute Convex Hull Boundary. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Given an array of 2D integer points points, where each point is [x, y], return all points that lie on the boundary of the convex hull of the set. Include collinear points that lie on the hull boundary. The output may be returned in any order, but each boundary point should appear only once.

Constraints

  • 1 <= len(points) <= 3000
  • points[i].length == 2
  • 0 <= x, y <= 10^4
  • All points are distinct

Function Signature

def convex_hull(points):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output