Search⌘ K
AI Features

Erect the Fence

Explore how to enclose a set of trees on a 2D plane using the shortest length of rope by computing their convex hull. Understand the geometric approach required to solve this classic problem efficiently, and practice implementing a solution that identifies all points on the fence perimeter. This lesson develops skills in mathematical problem-solving and geometry useful for technical coding interviews.

Statement

You are given an array of points, trees, where trees[i] = [xᵢ, yᵢ] represents the location of a tree ...